use of org.gradle.internal.component.external.model.AbstractRealisedModuleComponentResolveMetadata in project gradle by gradle.
the class ModuleComponentResolveMetadataSerializer method write.
@Override
public void write(Encoder encoder, ModuleComponentResolveMetadata value) throws Exception {
AbstractRealisedModuleComponentResolveMetadata transformed = assertRealized(value);
HashMap<ExternalDependencyDescriptor, Integer> deduplicationDependencyCache = Maps.newHashMap();
delegate.write(encoder, transformed, deduplicationDependencyCache);
writeOwners(encoder, value.getPlatformOwners());
if (transformed instanceof RealisedIvyModuleResolveMetadata) {
ivySerializationHelper.writeRealisedVariantsData(encoder, transformed);
ivySerializationHelper.writeRealisedConfigurationsData(encoder, transformed, deduplicationDependencyCache);
} else if (transformed instanceof RealisedMavenModuleResolveMetadata) {
mavenSerializationHelper.writeRealisedVariantsData(encoder, transformed);
mavenSerializationHelper.writeRealisedConfigurationsData(encoder, transformed, deduplicationDependencyCache);
} else {
throw new IllegalStateException("Unexpected realised module component resolve metadata type: " + transformed.getClass());
}
}
Aggregations