use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class DefaultLocalComponentMetadataBuilder method addConfiguration.
private BuildableLocalConfigurationMetadata addConfiguration(BuildableLocalComponentMetadata metaData, ConfigurationInternal configuration) {
configuration.preventFromFurtherMutation();
Set<String> hierarchy = Configurations.getNames(configuration.getHierarchy());
Set<String> extendsFrom = Configurations.getNames(configuration.getExtendsFrom());
// Presence of capabilities is bound to the definition of a capabilities extension to the project
ImmutableCapabilities capabilities = asImmutable(Configurations.collectCapabilities(configuration, Sets.<Capability>newHashSet(), Sets.<Configuration>newHashSet()));
return metaData.addConfiguration(configuration.getName(), configuration.getDescription(), extendsFrom, hierarchy, configuration.isVisible(), configuration.isTransitive(), configuration.getAttributes().asImmutable(), configuration.isCanBeConsumed(), configuration.isCanBeResolved(), capabilities);
}
use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class DefaultConfiguration method initAllDependencies.
private synchronized void initAllDependencies() {
if (allDependencies != null) {
return;
}
inheritedDependencies = CompositeDomainObjectSet.create(Dependency.class, ownDependencies);
for (Configuration configuration : this.extendsFrom) {
inheritedDependencies.addCollection(configuration.getAllDependencies());
}
allDependencies = new DefaultDependencySet(Describables.of(displayName, "all dependencies"), this, inheritedDependencies);
}
use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class DefaultConfiguration method initAllArtifacts.
private synchronized void initAllArtifacts() {
if (allArtifacts != null) {
return;
}
this.inheritedArtifacts = CompositeDomainObjectSet.create(PublishArtifact.class, ownArtifacts);
for (Configuration configuration : this.extendsFrom) {
inheritedArtifacts.addCollection(configuration.getAllArtifacts());
}
this.allArtifacts = new DefaultPublishArtifactSet(Describables.of(displayName, "all artifacts"), inheritedArtifacts, fileCollectionFactory);
}
use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class DefaultConfiguration method initAllDependencyConstraints.
private synchronized void initAllDependencyConstraints() {
if (allDependencyConstraints != null) {
return;
}
inheritedDependencyConstraints = CompositeDomainObjectSet.create(DependencyConstraint.class, ownDependencyConstraints);
for (Configuration configuration : this.extendsFrom) {
inheritedDependencyConstraints.addCollection(configuration.getAllDependencyConstraints());
}
allDependencyConstraints = new DefaultDependencyConstraintSet(Describables.of(displayName, "all dependency constraints"), inheritedDependencyConstraints);
}
use of org.gradle.api.artifacts.Configuration in project gradle by gradle.
the class DefaultConfiguration method setExtendsFrom.
public Configuration setExtendsFrom(Iterable<Configuration> extendsFrom) {
validateMutation(MutationType.DEPENDENCIES);
for (Configuration configuration : this.extendsFrom) {
if (inheritedArtifacts != null) {
inheritedArtifacts.removeCollection(configuration.getAllArtifacts());
}
if (inheritedDependencies != null) {
inheritedDependencies.removeCollection(configuration.getAllDependencies());
}
if (inheritedDependencyConstraints != null) {
inheritedDependencyConstraints.removeCollection(configuration.getAllDependencyConstraints());
}
((ConfigurationInternal) configuration).removeMutationValidator(parentMutationValidator);
}
this.extendsFrom = new LinkedHashSet<Configuration>();
for (Configuration configuration : extendsFrom) {
extendsFrom(configuration);
}
return this;
}
Aggregations