use of org.gradle.internal.component.model.ComponentConfigurationIdentifier in project gradle by gradle.
the class DefaultLocalComponentMetadataBuilder method addConfiguration.
@Override
public BuildableLocalConfigurationMetadata addConfiguration(BuildableLocalComponentMetadata metaData, ConfigurationInternal configuration) {
BuildableLocalConfigurationMetadata configurationMetadata = createConfiguration(metaData, configuration);
metaData.addDependenciesAndExcludesForConfiguration(configuration, configurationMetadataBuilder);
ComponentConfigurationIdentifier configurationIdentifier = new ComponentConfigurationIdentifier(metaData.getId(), configuration.getName());
configuration.collectVariants(new ConfigurationInternal.VariantVisitor() {
@Override
public void visitArtifacts(Collection<? extends PublishArtifact> artifacts) {
metaData.addArtifacts(configuration.getName(), artifacts);
}
@Override
public void visitOwnVariant(DisplayName displayName, ImmutableAttributes attributes, Collection<? extends Capability> capabilities, Collection<? extends PublishArtifact> artifacts) {
metaData.addVariant(configuration.getName(), configuration.getName(), configurationIdentifier, displayName, attributes, ImmutableCapabilities.of(capabilities), artifacts);
}
@Override
public void visitChildVariant(String name, DisplayName displayName, ImmutableAttributes attributes, Collection<? extends Capability> capabilities, Collection<? extends PublishArtifact> artifacts) {
metaData.addVariant(configuration.getName(), configuration.getName() + "-" + name, new NestedVariantIdentifier(configurationIdentifier, name), displayName, attributes, ImmutableCapabilities.of(capabilities), artifacts);
}
});
return configurationMetadata;
}
use of org.gradle.internal.component.model.ComponentConfigurationIdentifier in project gradle by gradle.
the class DefaultArtifactSet method createForConfiguration.
public static ArtifactSet createForConfiguration(ComponentIdentifier componentIdentifier, ModuleVersionIdentifier ownerId, ConfigurationMetadata configuration, ImmutableList<? extends ComponentArtifactMetadata> artifacts, ModuleSources moduleSources, ExcludeSpec exclusions, AttributesSchemaInternal schema, ArtifactResolver artifactResolver, Map<ComponentArtifactIdentifier, ResolvableArtifact> allResolvedArtifacts, ArtifactTypeRegistry artifactTypeRegistry, ImmutableAttributes selectionAttributes, CalculatedValueContainerFactory calculatedValueContainerFactory) {
VariantResolveMetadata variantMetadata = new DefaultVariantMetadata(configuration.getName(), new ComponentConfigurationIdentifier(componentIdentifier, configuration.getName()), configuration.asDescribable(), configuration.getAttributes(), artifacts, configuration.getCapabilities());
ResolvedVariant resolvedVariant = toResolvedVariant(variantMetadata, ownerId, moduleSources, exclusions, artifactResolver, allResolvedArtifacts, artifactTypeRegistry, calculatedValueContainerFactory);
return new SingleVariantArtifactSet(componentIdentifier, schema, resolvedVariant, selectionAttributes);
}
Aggregations