use of org.gradle.internal.component.external.model.IvyDependencyDescriptor in project gradle by gradle.
the class IvyModuleDescriptorConverter method addDependency.
private void addDependency(List<IvyDependencyDescriptor> result, DependencyDescriptor dependencyDescriptor) {
ModuleRevisionId revisionId = dependencyDescriptor.getDependencyRevisionId();
ModuleComponentSelector requested = DefaultModuleComponentSelector.newSelector(revisionId.getOrganisation(), revisionId.getName(), new DefaultImmutableVersionConstraint(revisionId.getRevision()));
ListMultimap<String, String> configMappings = ArrayListMultimap.create();
for (Map.Entry<String, List<String>> entry : readConfigMappings(dependencyDescriptor).entrySet()) {
configMappings.putAll(entry.getKey(), entry.getValue());
}
List<Artifact> artifacts = Lists.newArrayList();
for (DependencyArtifactDescriptor ivyArtifact : dependencyDescriptor.getAllDependencyArtifacts()) {
IvyArtifactName ivyArtifactName = new DefaultIvyArtifactName(ivyArtifact.getName(), ivyArtifact.getType(), ivyArtifact.getExt(), (String) ivyArtifact.getExtraAttributes().get(CLASSIFIER));
artifacts.add(new Artifact(ivyArtifactName, Sets.newHashSet(ivyArtifact.getConfigurations())));
}
List<Exclude> excludes = Lists.newArrayList();
for (ExcludeRule excludeRule : dependencyDescriptor.getAllExcludeRules()) {
excludes.add(forIvyExclude(excludeRule));
}
result.add(new IvyDependencyDescriptor(requested, dependencyDescriptor.getDynamicConstraintDependencyRevisionId().getRevision(), dependencyDescriptor.isChanging(), dependencyDescriptor.isTransitive(), false, configMappings, artifacts, excludes));
}
use of org.gradle.internal.component.external.model.IvyDependencyDescriptor in project gradle by gradle.
the class IvyModuleResolveMetaDataBuilder method build.
public MutableIvyModuleResolveMetadata build() {
ModuleRevisionId moduleRevisionId = ivyDescriptor.getModuleRevisionId();
ModuleComponentIdentifier cid = DefaultModuleComponentIdentifier.newId(moduleRevisionId.getOrganisation(), moduleRevisionId.getName(), moduleRevisionId.getRevision());
List<Configuration> configurations = converter.extractConfigurations(ivyDescriptor);
List<IvyDependencyDescriptor> dependencies = converter.extractDependencies(ivyDescriptor);
List<Exclude> excludes = converter.extractExcludes(ivyDescriptor);
Map<NamespaceId, String> extraAttributes = converter.extractExtraAttributes(ivyDescriptor);
MutableIvyModuleResolveMetadata metadata = metadataFactory.create(cid, dependencies, configurations, artifacts, excludes);
metadata.setStatus(ivyDescriptor.getStatus());
metadata.setExtraAttributes(extraAttributes);
metadata.setBranch(ivyDescriptor.getModuleRevisionId().getBranch());
return metadata;
}
Aggregations