use of org.gradle.internal.component.model.PersistentModuleSource in project gradle by gradle.
the class ModuleSourcesSerializer method write.
@Override
public void write(Encoder encoder, ModuleSources value) throws IOException {
value.withSources(source -> {
try {
if (source instanceof PersistentModuleSource) {
PersistentModuleSource persistentModuleSource = (PersistentModuleSource) source;
int codecId = assertValidId(persistentModuleSource.getCodecId());
encoder.writeSmallInt(codecId);
PersistentModuleSource.Codec<PersistentModuleSource> codec = Cast.uncheckedCast(moduleSourceCodecs.get(codecId));
codec.encode(persistentModuleSource, encoder);
}
} catch (IOException e) {
throw new UncheckedIOException(e);
}
});
// end of sources
encoder.writeSmallInt(0);
}
Aggregations