use of org.gradle.internal.component.model.ExcludeMetadata in project gradle by gradle.
the class ModuleMetadataParser method consumeDependencies.
private List<ModuleDependency> consumeDependencies(JsonReader reader) throws IOException {
List<ModuleDependency> dependencies = new ArrayList<ModuleDependency>();
reader.beginArray();
while (reader.peek() != END_ARRAY) {
reader.beginObject();
String group = null;
String module = null;
String reason = null;
VersionConstraint version = DefaultImmutableVersionConstraint.of();
ImmutableList<ExcludeMetadata> excludes = ImmutableList.of();
while (reader.peek() != END_OBJECT) {
String name = reader.nextName();
if (name.equals("group")) {
group = reader.nextString();
} else if (name.equals("module")) {
module = reader.nextString();
} else if (name.equals("version")) {
version = consumeVersion(reader);
} else if (name.equals("excludes")) {
excludes = consumeExcludes(reader);
} else if (name.equals("reason")) {
reason = reader.nextString();
} else {
consumeAny(reader);
}
}
dependencies.add(new ModuleDependency(group, module, version, excludes, reason));
reader.endObject();
}
reader.endArray();
return dependencies;
}
use of org.gradle.internal.component.model.ExcludeMetadata in project gradle by gradle.
the class ModuleMetadataParser method consumeExcludes.
private ImmutableList<ExcludeMetadata> consumeExcludes(JsonReader reader) throws IOException {
ImmutableList.Builder<ExcludeMetadata> builder = new ImmutableList.Builder<ExcludeMetadata>();
reader.beginArray();
while (reader.peek() != END_ARRAY) {
reader.beginObject();
String group = null;
String module = null;
while (reader.peek() != END_OBJECT) {
String name = reader.nextName();
if (name.equals("group")) {
group = reader.nextString();
} else if (name.equals("module")) {
module = reader.nextString();
} else {
consumeAny(reader);
}
}
reader.endObject();
ExcludeMetadata exclude = excludeRuleConverter.createExcludeRule(group, module);
builder.add(exclude);
}
reader.endArray();
return builder.build();
}
use of org.gradle.internal.component.model.ExcludeMetadata in project gradle by gradle.
the class ProjectIvyDependencyDescriptorFactory method createDependencyDescriptor.
public LocalOriginDependencyMetadata createDependencyDescriptor(ComponentIdentifier componentId, String clientConfiguration, AttributeContainer clientAttributes, ModuleDependency dependency) {
ProjectDependencyInternal projectDependency = (ProjectDependencyInternal) dependency;
projectDependency.beforeResolved();
ComponentSelector selector = DefaultProjectComponentSelector.newSelector(projectDependency.getDependencyProject());
List<ExcludeMetadata> excludes = convertExcludeRules(clientConfiguration, dependency.getExcludeRules());
LocalComponentDependencyMetadata dependencyMetaData = new LocalComponentDependencyMetadata(componentId, selector, clientConfiguration, clientAttributes, projectDependency.getTargetConfiguration(), convertArtifacts(dependency.getArtifacts()), excludes, false, false, dependency.isTransitive(), false, dependency.getReason());
return new DslOriginDependencyMetadataWrapper(dependencyMetaData, dependency);
}
use of org.gradle.internal.component.model.ExcludeMetadata in project gradle by gradle.
the class DefaultIvyModuleDescriptorWriter method printDependencyExcludeRules.
private static void printDependencyExcludeRules(SimpleXmlWriter writer, Collection<ExcludeMetadata> excludes) throws IOException {
for (ExcludeMetadata exclude : excludes) {
writer.startElement("exclude");
writer.attribute("org", exclude.getModuleId().getGroup());
writer.attribute("module", exclude.getModuleId().getName());
IvyArtifactName artifact = exclude.getArtifact();
if (artifact != null) {
writer.attribute("name", artifact.getName());
writer.attribute("type", artifact.getType());
writer.attribute("ext", artifact.getExtension());
}
writer.endElement();
}
}
Aggregations