Search in sources :

Example 1 with DefaultSerializerRegistry

use of org.gradle.internal.serialize.DefaultSerializerRegistry in project gradle by gradle.

the class WorkerJvmMemoryInfoSerializer method create.

public static SerializerRegistry create() {
    DefaultSerializerRegistry registry = new DefaultSerializerRegistry(false);
    registry.register(JvmMemoryStatus.class, new JvmMemoryStatusSerializer());
    return registry;
}
Also used : DefaultSerializerRegistry(org.gradle.internal.serialize.DefaultSerializerRegistry)

Example 2 with DefaultSerializerRegistry

use of org.gradle.internal.serialize.DefaultSerializerRegistry 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)

Example 3 with DefaultSerializerRegistry

use of org.gradle.internal.serialize.DefaultSerializerRegistry 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;
}
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) 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)

Example 4 with DefaultSerializerRegistry

use of org.gradle.internal.serialize.DefaultSerializerRegistry in project gradle by gradle.

the class TaskExecutionServices method createTaskArtifactStateRepository.

TaskArtifactStateRepository createTaskArtifactStateRepository(Instantiator instantiator, TaskHistoryStore cacheAccess, StartParameter startParameter, StringInterner stringInterner, FileCollectionFactory fileCollectionFactory, ClassLoaderHierarchyHasher classLoaderHierarchyHasher, FileCollectionSnapshotterRegistry fileCollectionSnapshotterRegistry, TaskCacheKeyCalculator cacheKeyCalculator, ValueSnapshotter valueSnapshotter) {
    OutputFilesSnapshotter outputFilesSnapshotter = new OutputFilesSnapshotter();
    SerializerRegistry serializerRegistry = new DefaultSerializerRegistry();
    for (FileCollectionSnapshotter snapshotter : fileCollectionSnapshotterRegistry.getAllSnapshotters()) {
        snapshotter.registerSerializers(serializerRegistry);
    }
    TaskHistoryRepository taskHistoryRepository = new CacheBackedTaskHistoryRepository(cacheAccess, new CacheBackedFileSnapshotRepository(cacheAccess, serializerRegistry.build(FileCollectionSnapshot.class), new RandomLongIdGenerator()), stringInterner);
    return new ShortCircuitTaskArtifactStateRepository(startParameter, instantiator, new DefaultTaskArtifactStateRepository(taskHistoryRepository, instantiator, outputFilesSnapshotter, fileCollectionSnapshotterRegistry, fileCollectionFactory, classLoaderHierarchyHasher, cacheKeyCalculator, valueSnapshotter));
}
Also used : ShortCircuitTaskArtifactStateRepository(org.gradle.api.internal.changedetection.changes.ShortCircuitTaskArtifactStateRepository) CacheBackedTaskHistoryRepository(org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository) TaskHistoryRepository(org.gradle.api.internal.changedetection.state.TaskHistoryRepository) OutputFilesSnapshotter(org.gradle.api.internal.changedetection.state.OutputFilesSnapshotter) DefaultSerializerRegistry(org.gradle.internal.serialize.DefaultSerializerRegistry) SerializerRegistry(org.gradle.internal.serialize.SerializerRegistry) CacheBackedTaskHistoryRepository(org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository) RandomLongIdGenerator(org.gradle.internal.id.RandomLongIdGenerator) DefaultSerializerRegistry(org.gradle.internal.serialize.DefaultSerializerRegistry) CacheBackedFileSnapshotRepository(org.gradle.api.internal.changedetection.state.CacheBackedFileSnapshotRepository) DefaultTaskArtifactStateRepository(org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository) DefaultGenericFileCollectionSnapshotter(org.gradle.api.internal.changedetection.state.DefaultGenericFileCollectionSnapshotter) FileCollectionSnapshotter(org.gradle.api.internal.changedetection.state.FileCollectionSnapshotter) GenericFileCollectionSnapshotter(org.gradle.api.internal.changedetection.state.GenericFileCollectionSnapshotter)

Aggregations

DefaultSerializerRegistry (org.gradle.internal.serialize.DefaultSerializerRegistry)4 LogLevel (org.gradle.api.logging.LogLevel)2 StyledTextOutputEvent (org.gradle.internal.logging.events.StyledTextOutputEvent)2 LogEventSerializer (org.gradle.internal.logging.serializer.LogEventSerializer)2 LogLevelChangeEventSerializer (org.gradle.internal.logging.serializer.LogLevelChangeEventSerializer)2 SpanSerializer (org.gradle.internal.logging.serializer.SpanSerializer)2 StyledTextOutputEventSerializer (org.gradle.internal.logging.serializer.StyledTextOutputEventSerializer)2 StyledTextOutput (org.gradle.internal.logging.text.StyledTextOutput)2 BaseSerializerFactory (org.gradle.internal.serialize.BaseSerializerFactory)2 ListSerializer (org.gradle.internal.serialize.ListSerializer)2 DefaultTaskArtifactStateRepository (org.gradle.api.internal.changedetection.changes.DefaultTaskArtifactStateRepository)1 ShortCircuitTaskArtifactStateRepository (org.gradle.api.internal.changedetection.changes.ShortCircuitTaskArtifactStateRepository)1 CacheBackedFileSnapshotRepository (org.gradle.api.internal.changedetection.state.CacheBackedFileSnapshotRepository)1 CacheBackedTaskHistoryRepository (org.gradle.api.internal.changedetection.state.CacheBackedTaskHistoryRepository)1 DefaultGenericFileCollectionSnapshotter (org.gradle.api.internal.changedetection.state.DefaultGenericFileCollectionSnapshotter)1 FileCollectionSnapshotter (org.gradle.api.internal.changedetection.state.FileCollectionSnapshotter)1 GenericFileCollectionSnapshotter (org.gradle.api.internal.changedetection.state.GenericFileCollectionSnapshotter)1 OutputFilesSnapshotter (org.gradle.api.internal.changedetection.state.OutputFilesSnapshotter)1 TaskHistoryRepository (org.gradle.api.internal.changedetection.state.TaskHistoryRepository)1 RandomLongIdGenerator (org.gradle.internal.id.RandomLongIdGenerator)1