use of org.gradle.internal.component.external.descriptor.Configuration in project gradle by gradle.
the class IvyModuleDescriptorConverter method addConfiguration.
private static void addConfiguration(List<Configuration> result, org.apache.ivy.core.module.descriptor.Configuration configuration) {
String name = configuration.getName();
boolean transitive = configuration.isTransitive();
boolean visible = configuration.getVisibility() == org.apache.ivy.core.module.descriptor.Configuration.Visibility.PUBLIC;
List<String> extendsFrom = Lists.newArrayList(configuration.getExtends());
result.add(new Configuration(name, transitive, visible, extendsFrom));
}
use of org.gradle.internal.component.external.descriptor.Configuration in project gradle by gradle.
the class IvyModuleResolveMetaDataBuilder method build.
public DefaultMutableIvyModuleResolveMetadata build() {
ModuleDescriptorState descriptorState = converter.forIvyModuleDescriptor(ivyDescriptor);
for (Artifact artifact : artifacts) {
descriptorState.addArtifact(artifact.getArtifactName(), artifact.getConfigurations());
}
List<Configuration> configurations = converter.extractConfigurations(ivyDescriptor);
List<IvyDependencyMetadata> dependencies = converter.extractDependencies(ivyDescriptor);
ModuleComponentIdentifier cid = descriptorState.getComponentIdentifier();
ModuleVersionIdentifier mvi = moduleIdentifierFactory.moduleWithVersion(cid.getGroup(), cid.getModule(), cid.getVersion());
return new DefaultMutableIvyModuleResolveMetadata(mvi, cid, descriptorState, configurations, dependencies);
}
use of org.gradle.internal.component.external.descriptor.Configuration in project gradle by gradle.
the class AbstractModuleComponentResolveMetadata method populateConfigurationFromDescriptor.
private DefaultConfigurationMetadata populateConfigurationFromDescriptor(String name, Map<String, Configuration> configurationDefinitions, Map<String, DefaultConfigurationMetadata> configurations) {
DefaultConfigurationMetadata populated = configurations.get(name);
if (populated != null) {
return populated;
}
Configuration descriptorConfiguration = configurationDefinitions.get(name);
List<String> extendsFrom = descriptorConfiguration.getExtendsFrom();
boolean transitive = descriptorConfiguration.isTransitive();
boolean visible = descriptorConfiguration.isVisible();
if (extendsFrom.isEmpty()) {
// tail
populated = new DefaultConfigurationMetadata(componentIdentifier, name, transitive, visible, excludes);
configurations.put(name, populated);
return populated;
} else if (extendsFrom.size() == 1) {
populated = new DefaultConfigurationMetadata(componentIdentifier, name, transitive, visible, Collections.singletonList(populateConfigurationFromDescriptor(extendsFrom.get(0), configurationDefinitions, configurations)), excludes);
configurations.put(name, populated);
return populated;
}
List<DefaultConfigurationMetadata> hierarchy = new ArrayList<DefaultConfigurationMetadata>(extendsFrom.size());
for (String confName : extendsFrom) {
hierarchy.add(populateConfigurationFromDescriptor(confName, configurationDefinitions, configurations));
}
populated = new DefaultConfigurationMetadata(componentIdentifier, name, transitive, visible, hierarchy, excludes);
configurations.put(name, populated);
return populated;
}
use of org.gradle.internal.component.external.descriptor.Configuration in project gradle by gradle.
the class DefaultIvyModulePublishMetadata method addConfiguration.
@Override
public void addConfiguration(String name, String description, Set<String> extendsFrom, Set<String> hierarchy, boolean visible, boolean transitive, AttributeContainerInternal attributes, boolean canBeConsumed, boolean canBeResolved) {
List<String> sortedExtends = Lists.newArrayList(extendsFrom);
Collections.sort(sortedExtends);
Configuration configuration = new Configuration(name, transitive, visible, sortedExtends);
configurations.put(name, configuration);
}
use of org.gradle.internal.component.external.descriptor.Configuration in project gradle by gradle.
the class GradlePomModuleDescriptorBuilder method addDependencyForRelocation.
public void addDependencyForRelocation(ModuleVersionSelector selector) {
// Example: http://repo2.maven.org/maven2/com/atomikos/atomikos-util/3.6.4/atomikos-util-3.6.4.pom
if (selector.getGroup().equals(descriptor.getComponentIdentifier().getGroup()) && selector.getName().equals(descriptor.getComponentIdentifier().getModule())) {
return;
}
// TODO - this is a constant
ListMultimap<String, String> confMappings = ArrayListMultimap.create();
// Map dependency on all public configurations
for (Configuration m2Conf : GradlePomModuleDescriptorBuilder.MAVEN2_CONFIGURATIONS.values()) {
if (m2Conf.isVisible()) {
confMappings.put(m2Conf.getName(), m2Conf.getName());
}
}
dependencies.add(new IvyDependencyMetadata(selector, confMappings));
}
Aggregations