Search in sources :

Example 1 with RealisedMavenModuleResolveMetadata

use of org.gradle.internal.component.external.model.maven.RealisedMavenModuleResolveMetadata 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());
    }
}
Also used : RealisedIvyModuleResolveMetadata(org.gradle.internal.component.external.model.ivy.RealisedIvyModuleResolveMetadata) ExternalDependencyDescriptor(org.gradle.internal.component.external.model.ExternalDependencyDescriptor) AbstractRealisedModuleComponentResolveMetadata(org.gradle.internal.component.external.model.AbstractRealisedModuleComponentResolveMetadata) RealisedMavenModuleResolveMetadata(org.gradle.internal.component.external.model.maven.RealisedMavenModuleResolveMetadata)

Aggregations

AbstractRealisedModuleComponentResolveMetadata (org.gradle.internal.component.external.model.AbstractRealisedModuleComponentResolveMetadata)1 ExternalDependencyDescriptor (org.gradle.internal.component.external.model.ExternalDependencyDescriptor)1 RealisedIvyModuleResolveMetadata (org.gradle.internal.component.external.model.ivy.RealisedIvyModuleResolveMetadata)1 RealisedMavenModuleResolveMetadata (org.gradle.internal.component.external.model.maven.RealisedMavenModuleResolveMetadata)1