use of org.gradle.internal.component.model.VariantWithOverloadAttributes in project gradle by gradle.
the class ProjectArtifactSetResolver method mapVariant.
private ResolvedVariant mapVariant(ModuleVersionIdentifier ownerId, ModuleSources moduleSources, ExcludeSpec exclusions, ArtifactTypeRegistry artifactTypeRegistry, VariantResolveMetadata variant) {
VariantResolveMetadata.Identifier identifier = variant.getIdentifier();
if (identifier == null) {
throw new IllegalArgumentException(String.format("Project variant %s does not have an identifier.", variant.asDescribable()));
}
// Apply any artifact type mappings to the attributes of the variant
ImmutableAttributes variantAttributes = artifactTypeRegistry.mapAttributesFor(variant.getAttributes().asImmutable(), variant.getArtifacts());
if (exclusions.mayExcludeArtifacts()) {
// Some artifact may be excluded, so do not reuse. It might be better to apply the exclusions and reuse if none of them apply
return DefaultArtifactSet.toResolvedVariant(variant, ownerId, moduleSources, exclusions, artifactResolver, allProjectArtifacts, variantAttributes, calculatedValueContainerFactory);
}
VariantWithOverloadAttributes key = new VariantWithOverloadAttributes(identifier, variantAttributes);
return allProjectVariants.computeIfAbsent(key, k -> DefaultArtifactSet.toResolvedVariant(variant, ownerId, moduleSources, exclusions, artifactResolver, allProjectArtifacts, variantAttributes, calculatedValueContainerFactory));
}
Aggregations