Search in sources :

Example 1 with ProgressEventSerializer

use of org.gradle.internal.logging.serializer.ProgressEventSerializer 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);
}
Also used : LogLevelChangeEventSerializer(org.gradle.internal.logging.serializer.LogLevelChangeEventSerializer) ListSerializer(org.gradle.internal.serialize.ListSerializer) SpanSerializer(org.gradle.internal.logging.serializer.SpanSerializer) DefaultSerializerRegistry(org.gradle.internal.serialize.DefaultSerializerRegistry) StyledTextOutput(org.gradle.internal.logging.text.StyledTextOutput) ProgressEventSerializer(org.gradle.internal.logging.serializer.ProgressEventSerializer) ProgressCompleteEventSerializer(org.gradle.internal.logging.serializer.ProgressCompleteEventSerializer) LogLevel(org.gradle.api.logging.LogLevel) LogEventSerializer(org.gradle.internal.logging.serializer.LogEventSerializer) BaseSerializerFactory(org.gradle.internal.serialize.BaseSerializerFactory) StyledTextOutputEventSerializer(org.gradle.internal.logging.serializer.StyledTextOutputEventSerializer) StyledTextOutputEvent(org.gradle.internal.logging.events.StyledTextOutputEvent)

Aggregations

LogLevel (org.gradle.api.logging.LogLevel)1 StyledTextOutputEvent (org.gradle.internal.logging.events.StyledTextOutputEvent)1 LogEventSerializer (org.gradle.internal.logging.serializer.LogEventSerializer)1 LogLevelChangeEventSerializer (org.gradle.internal.logging.serializer.LogLevelChangeEventSerializer)1 ProgressCompleteEventSerializer (org.gradle.internal.logging.serializer.ProgressCompleteEventSerializer)1 ProgressEventSerializer (org.gradle.internal.logging.serializer.ProgressEventSerializer)1 SpanSerializer (org.gradle.internal.logging.serializer.SpanSerializer)1 StyledTextOutputEventSerializer (org.gradle.internal.logging.serializer.StyledTextOutputEventSerializer)1 StyledTextOutput (org.gradle.internal.logging.text.StyledTextOutput)1 BaseSerializerFactory (org.gradle.internal.serialize.BaseSerializerFactory)1 DefaultSerializerRegistry (org.gradle.internal.serialize.DefaultSerializerRegistry)1 ListSerializer (org.gradle.internal.serialize.ListSerializer)1