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;
}
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);
}
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;
}
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));
}
Aggregations