Search in sources :

Example 51 with IvyArtifactName

use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.

the class RealisedIvyModuleResolveMetadataSerializationHelper method writeExcludeRules.

private void writeExcludeRules(Encoder encoder, List<Exclude> excludes) throws IOException {
    encoder.writeSmallInt(excludes.size());
    for (Exclude exclude : excludes) {
        encoder.writeString(exclude.getModuleId().getGroup());
        encoder.writeString(exclude.getModuleId().getName());
        IvyArtifactName artifact = exclude.getArtifact();
        writeNullableArtifact(encoder, artifact);
        writeStringSet(encoder, exclude.getConfigurations());
        encoder.writeNullableString(exclude.getMatcher());
    }
}
Also used : Exclude(org.gradle.internal.component.model.Exclude) DefaultExclude(org.gradle.internal.component.external.descriptor.DefaultExclude) DefaultIvyArtifactName(org.gradle.internal.component.model.DefaultIvyArtifactName) IvyArtifactName(org.gradle.internal.component.model.IvyArtifactName)

Example 52 with IvyArtifactName

use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.

the class RealisedMavenModuleResolveMetadataSerializationHelper method readMavenDependency.

private MavenDependencyDescriptor readMavenDependency(Decoder decoder, Map<Integer, MavenDependencyDescriptor> deduplicationDependencyCache) throws IOException {
    int mapping = decoder.readSmallInt();
    if (mapping == deduplicationDependencyCache.size()) {
        ModuleComponentSelector requested = getComponentSelectorSerializer().read(decoder);
        IvyArtifactName artifactName = readNullableArtifact(decoder);
        List<ExcludeMetadata> mavenExcludes = readMavenExcludes(decoder);
        MavenScope scope = MavenScope.values()[decoder.readSmallInt()];
        MavenDependencyType type = MavenDependencyType.values()[decoder.readSmallInt()];
        MavenDependencyDescriptor mavenDependencyDescriptor = new MavenDependencyDescriptor(scope, type, requested, artifactName, mavenExcludes);
        deduplicationDependencyCache.put(mapping, mavenDependencyDescriptor);
        return mavenDependencyDescriptor;
    } else {
        MavenDependencyDescriptor mavenDependencyDescriptor = deduplicationDependencyCache.get(mapping);
        assert mavenDependencyDescriptor != null;
        return mavenDependencyDescriptor;
    }
}
Also used : MavenScope(org.gradle.internal.component.external.descriptor.MavenScope) ModuleComponentSelector(org.gradle.api.artifacts.component.ModuleComponentSelector) IvyArtifactName(org.gradle.internal.component.model.IvyArtifactName) ExcludeMetadata(org.gradle.internal.component.model.ExcludeMetadata)

Aggregations

IvyArtifactName (org.gradle.internal.component.model.IvyArtifactName)52 DefaultIvyArtifactName (org.gradle.internal.component.model.DefaultIvyArtifactName)28 DefaultExclude (org.gradle.internal.component.external.descriptor.DefaultExclude)7 ExcludeMetadata (org.gradle.internal.component.model.ExcludeMetadata)7 File (java.io.File)6 Artifact (org.gradle.internal.component.external.descriptor.Artifact)6 ModuleIdentifier (org.gradle.api.artifacts.ModuleIdentifier)5 ComponentArtifactIdentifier (org.gradle.api.artifacts.component.ComponentArtifactIdentifier)5 ModuleComponentSelector (org.gradle.api.artifacts.component.ModuleComponentSelector)5 ImmutableList (com.google.common.collect.ImmutableList)4 DefaultImmutableVersionConstraint (org.gradle.api.internal.artifacts.dependencies.DefaultImmutableVersionConstraint)4 ComponentArtifactMetadata (org.gradle.internal.component.model.ComponentArtifactMetadata)4 ImmutableSet (com.google.common.collect.ImmutableSet)3 List (java.util.List)3 Map (java.util.Map)3 ModuleRevisionId (org.apache.ivy.core.module.id.ModuleRevisionId)3 ModuleVersionSelector (org.gradle.api.artifacts.ModuleVersionSelector)3 DefaultResolvedArtifact (org.gradle.api.internal.artifacts.DefaultResolvedArtifact)3 ImmutableAttributes (org.gradle.api.internal.attributes.ImmutableAttributes)3 MavenScope (org.gradle.internal.component.external.descriptor.MavenScope)3