use of org.gradle.internal.component.model.Exclude 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.model.Exclude 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.model.Exclude in project gradle by gradle.
the class IvyXmlModuleDescriptorWriter method printAllExcludes.
private static void printAllExcludes(IvyModulePublishMetadata metadata, SimpleXmlWriter writer) throws IOException {
List<Exclude> excludes = metadata.getModuleDescriptor().getExcludes();
for (Exclude exclude : excludes) {
writer.startElement("exclude");
writer.attribute("org", exclude.getModuleId().getGroup());
writer.attribute("module", exclude.getModuleId().getName());
writer.attribute("artifact", exclude.getArtifact().getName());
writer.attribute("type", exclude.getArtifact().getType());
writer.attribute("ext", exclude.getArtifact().getExtension());
Set<String> ruleConfs = exclude.getConfigurations();
if (!metadata.getConfigurations().keySet().equals(ruleConfs)) {
writer.attribute("conf", Joiner.on(',').join(ruleConfs));
}
writer.attribute("matcher", exclude.getMatcher());
writer.endElement();
}
}
use of org.gradle.internal.component.model.Exclude in project gradle by gradle.
the class ProjectIvyDependencyDescriptorFactory method createDependencyDescriptor.
public DslOriginDependencyMetadata createDependencyDescriptor(String clientConfiguration, AttributeContainer clientAttributes, ModuleDependency dependency) {
ProjectDependencyInternal projectDependency = (ProjectDependencyInternal) dependency;
projectDependency.beforeResolved();
Module module = getProjectModule(dependency);
ModuleVersionSelector requested = new DefaultModuleVersionSelector(module.getGroup(), module.getName(), module.getVersion());
ComponentSelector selector = DefaultProjectComponentSelector.newSelector(projectDependency.getDependencyProject());
List<Exclude> excludes = convertExcludeRules(clientConfiguration, dependency.getExcludeRules());
LocalComponentDependencyMetadata dependencyMetaData = new LocalComponentDependencyMetadata(selector, requested, clientConfiguration, clientAttributes, projectDependency.getTargetConfiguration(), convertArtifacts(dependency.getArtifacts()), excludes, false, false, dependency.isTransitive());
return new DslOriginDependencyMetadataWrapper(dependencyMetaData, dependency);
}
use of org.gradle.internal.component.model.Exclude in project gradle by gradle.
the class IvyXmlModuleDescriptorWriter method printDependencyExcludeRules.
private static void printDependencyExcludeRules(IvyModulePublishMetadata metadata, SimpleXmlWriter writer, Collection<Exclude> excludes) throws IOException {
for (Exclude exclude : excludes) {
writer.startElement("exclude");
writer.attribute("org", exclude.getModuleId().getGroup());
writer.attribute("module", exclude.getModuleId().getName());
writer.attribute("name", exclude.getArtifact().getName());
writer.attribute("type", exclude.getArtifact().getType());
writer.attribute("ext", exclude.getArtifact().getExtension());
Set<String> ruleConfs = exclude.getConfigurations();
if (!metadata.getConfigurations().keySet().equals(ruleConfs)) {
writer.attribute("conf", Joiner.on(',').join(ruleConfs));
}
writer.attribute("matcher", exclude.getMatcher());
writer.endElement();
}
}
Aggregations