use of org.gradle.internal.serialize.ListSerializer in project gradle by gradle.
the class DaemonMessageSerializer method create.
public static Serializer<Message> create() {
BaseSerializerFactory factory = new BaseSerializerFactory();
Serializer<LogLevel> logLevelSerializer = factory.getSerializerFor(LogLevel.class);
Serializer<Throwable> throwableSerializer = factory.getSerializerFor(Throwable.class);
DefaultSerializerRegistry registry = new DefaultSerializerRegistry();
registry.register(BuildEvent.class, new BuildEventSerializer());
registry.register(Failure.class, new FailureSerializer(throwableSerializer));
// 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(StyledTextOutputEvent.class, new StyledTextOutputEventSerializer(logLevelSerializer, new ListSerializer<StyledTextOutputEvent.Span>(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);
}
use of org.gradle.internal.serialize.ListSerializer in project gradle by gradle.
the class WorkerLoggingSerializer method create.
public static SerializerRegistry create() {
DefaultSerializerRegistry registry = new DefaultSerializerRegistry(false);
BaseSerializerFactory factory = new BaseSerializerFactory();
Serializer<LogLevel> logLevelSerializer = factory.getSerializerFor(LogLevel.class);
Serializer<Throwable> throwableSerializer = factory.getSerializerFor(Throwable.class);
// Log events
registry.register(LogEvent.class, new LogEventSerializer(logLevelSerializer, throwableSerializer));
registry.register(StyledTextOutputEvent.class, new StyledTextOutputEventSerializer(logLevelSerializer, new ListSerializer<StyledTextOutputEvent.Span>(new SpanSerializer(factory.getSerializerFor(StyledTextOutput.Style.class)))));
registry.register(LogLevelChangeEvent.class, new LogLevelChangeEventSerializer(logLevelSerializer));
return registry;
}
Aggregations