Search in sources :

Example 1 with PromptOutputEventSerializer

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

Aggregations

LogLevel (org.gradle.api.logging.LogLevel)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 ProgressStartEventSerializer (org.gradle.internal.logging.serializer.ProgressStartEventSerializer)1 PromptOutputEventSerializer (org.gradle.internal.logging.serializer.PromptOutputEventSerializer)1 SpanSerializer (org.gradle.internal.logging.serializer.SpanSerializer)1 StyledTextOutputEventSerializer (org.gradle.internal.logging.serializer.StyledTextOutputEventSerializer)1 UserInputRequestEventSerializer (org.gradle.internal.logging.serializer.UserInputRequestEventSerializer)1 UserInputResumeEventSerializer (org.gradle.internal.logging.serializer.UserInputResumeEventSerializer)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