use of org.gradle.internal.logging.serializer.PromptOutputEventSerializer in project gradle by gradle.
the class DaemonMessageSerializer method create.
public static Serializer<Message> create(Serializer<BuildAction> buildActionSerializer) {
BaseSerializerFactory factory = new BaseSerializerFactory();
Serializer<LogLevel> logLevelSerializer = factory.getSerializerFor(LogLevel.class);
Serializer<Throwable> throwableSerializer = factory.getSerializerFor(Throwable.class);
DefaultSerializerRegistry registry = new DefaultSerializerRegistry();
// Lifecycle messages
registry.register(Build.class, new BuildSerializer(buildActionSerializer));
registry.register(Cancel.class, new CancelSerializer());
registry.register(DaemonUnavailable.class, new DaemonUnavailableSerializer());
registry.register(BuildStarted.class, new BuildStartedSerializer());
registry.register(Failure.class, new FailureSerializer(throwableSerializer));
registry.register(Success.class, new SuccessSerializer());
registry.register(Finished.class, new FinishedSerializer());
// Build events
registry.register(BuildEvent.class, new BuildEventSerializer());
// Input events
registry.register(ForwardInput.class, new ForwardInputSerializer());
registry.register(CloseInput.class, new CloseInputSerializer());
// Output events
registry.register(LogEvent.class, new LogEventSerializer(logLevelSerializer, throwableSerializer));
registry.register(UserInputRequestEvent.class, new UserInputRequestEventSerializer());
registry.register(PromptOutputEvent.class, new PromptOutputEventSerializer());
registry.register(UserInputResumeEvent.class, new UserInputResumeEventSerializer());
registry.register(StyledTextOutputEvent.class, new StyledTextOutputEventSerializer(logLevelSerializer, new ListSerializer<>(new SpanSerializer(factory.getSerializerFor(StyledTextOutput.Style.class)))));
registry.register(ProgressStartEvent.class, new ProgressStartEventSerializer());
registry.register(ProgressCompleteEvent.class, new ProgressCompleteEventSerializer());
registry.register(ProgressEvent.class, new ProgressEventSerializer());
registry.register(LogLevelChangeEvent.class, new LogLevelChangeEventSerializer(logLevelSerializer));
registry.register(OutputMessage.class, new OutputMessageSerializer(registry.build(OutputEvent.class)));
// Default for everything else
registry.useJavaSerialization(Message.class);
return registry.build(Message.class);
}
Aggregations