use of org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor in project gradle by gradle.
the class IvyModuleResolveMetaDataBuilder method build.
public MutableIvyModuleResolveMetadata build() {
ModuleRevisionId moduleRevisionId = ivyDescriptor.getModuleRevisionId();
ModuleComponentIdentifier cid = DefaultModuleComponentIdentifier.newId(DefaultModuleIdentifier.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;
}
use of org.gradle.internal.component.external.model.ivy.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(DefaultModuleIdentifier.newId(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.ivy.IvyDependencyDescriptor in project gradle by gradle.
the class DirectDependencyMetadataAdapter method getIvyArtifacts.
private List<IvyArtifactName> getIvyArtifacts() {
ModuleDependencyMetadata originalMetadata = getOriginalMetadata();
if (originalMetadata instanceof ConfigurationBoundExternalDependencyMetadata) {
ConfigurationBoundExternalDependencyMetadata externalMetadata = (ConfigurationBoundExternalDependencyMetadata) originalMetadata;
ExternalDependencyDescriptor descriptor = externalMetadata.getDependencyDescriptor();
if (descriptor instanceof MavenDependencyDescriptor) {
return fromMavenDescriptor((MavenDependencyDescriptor) descriptor);
}
if (descriptor instanceof IvyDependencyDescriptor) {
return fromIvyDescriptor((IvyDependencyDescriptor) descriptor);
}
} else if (originalMetadata instanceof GradleDependencyMetadata) {
return fromGradleMetadata((GradleDependencyMetadata) originalMetadata);
}
return Collections.emptyList();
}
Aggregations