Search in sources :

Example 1 with AbstractLazyModuleComponentResolveMetadata

use of org.gradle.internal.component.external.model.AbstractLazyModuleComponentResolveMetadata in project gradle by gradle.

the class ModuleComponentResolveMetadataSerializer method read.

@Override
public ModuleComponentResolveMetadata read(Decoder decoder) throws EOFException, Exception {
    Map<Integer, MavenDependencyDescriptor> deduplicationDependencyCache = Maps.newHashMap();
    MutableModuleComponentResolveMetadata mutable = delegate.read(decoder, moduleIdentifierFactory, deduplicationDependencyCache);
    readPlatformOwners(decoder, mutable);
    AbstractLazyModuleComponentResolveMetadata resolveMetadata = (AbstractLazyModuleComponentResolveMetadata) mutable.asImmutable();
    if (resolveMetadata instanceof DefaultIvyModuleResolveMetadata) {
        return ivySerializationHelper.readMetadata(decoder, (DefaultIvyModuleResolveMetadata) resolveMetadata);
    } else if (resolveMetadata instanceof DefaultMavenModuleResolveMetadata) {
        return mavenSerializationHelper.readMetadata(decoder, (DefaultMavenModuleResolveMetadata) resolveMetadata, deduplicationDependencyCache);
    } else {
        throw new IllegalStateException("Unknown resolved metadata type: " + resolveMetadata.getClass());
    }
}
Also used : MutableModuleComponentResolveMetadata(org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata) DefaultIvyModuleResolveMetadata(org.gradle.internal.component.external.model.ivy.DefaultIvyModuleResolveMetadata) MavenDependencyDescriptor(org.gradle.internal.component.external.model.maven.MavenDependencyDescriptor) DefaultMavenModuleResolveMetadata(org.gradle.internal.component.external.model.maven.DefaultMavenModuleResolveMetadata) AbstractLazyModuleComponentResolveMetadata(org.gradle.internal.component.external.model.AbstractLazyModuleComponentResolveMetadata)

Aggregations

AbstractLazyModuleComponentResolveMetadata (org.gradle.internal.component.external.model.AbstractLazyModuleComponentResolveMetadata)1 MutableModuleComponentResolveMetadata (org.gradle.internal.component.external.model.MutableModuleComponentResolveMetadata)1 DefaultIvyModuleResolveMetadata (org.gradle.internal.component.external.model.ivy.DefaultIvyModuleResolveMetadata)1 DefaultMavenModuleResolveMetadata (org.gradle.internal.component.external.model.maven.DefaultMavenModuleResolveMetadata)1 MavenDependencyDescriptor (org.gradle.internal.component.external.model.maven.MavenDependencyDescriptor)1