use of org.gradle.api.internal.artifacts.ivyservice.NamespaceId in project gradle by gradle.
the class IvyXmlModuleDescriptorWriter method printInfoTag.
private static void printInfoTag(ModuleDescriptorState descriptor, SimpleXmlWriter writer) throws IOException {
ModuleComponentIdentifier id = descriptor.getComponentIdentifier();
writer.startElement("info");
writer.attribute("organisation", id.getGroup());
writer.attribute("module", id.getModule());
String branch = descriptor.getBranch();
if (branch != null) {
writer.attribute("branch", branch);
}
writer.attribute("revision", id.getVersion());
writer.attribute("status", descriptor.getStatus());
if (descriptor.isGenerated()) {
writer.attribute("default", "true");
}
printUnusedContent(descriptor, writer);
for (Map.Entry<NamespaceId, String> entry : descriptor.getExtraInfo().entrySet()) {
if (entry.getValue() == null || entry.getValue().length() == 0) {
continue;
}
NamespaceId namespaceId = entry.getKey();
writer.startElement("ns:" + namespaceId.getName());
writer.attribute("xmlns:ns", namespaceId.getNamespace());
writer.characters(entry.getValue());
writer.endElement();
}
writer.endElement();
}
use of org.gradle.api.internal.artifacts.ivyservice.NamespaceId 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.api.internal.artifacts.ivyservice.NamespaceId in project gradle by gradle.
the class IvyModuleDescriptorConverter method forIvyModuleDescriptor.
public ModuleDescriptorState forIvyModuleDescriptor(ModuleDescriptor ivyDescriptor) {
ModuleRevisionId moduleRevisionId = ivyDescriptor.getModuleRevisionId();
ModuleComponentIdentifier componentIdentifier = DefaultModuleComponentIdentifier.newId(moduleRevisionId.getOrganisation(), moduleRevisionId.getName(), moduleRevisionId.getRevision());
MutableModuleDescriptorState state = new MutableModuleDescriptorState(componentIdentifier, ivyDescriptor.getStatus(), ivyDescriptor.isDefault());
state.setBranch(moduleRevisionId.getBranch());
state.setDescription(ivyDescriptor.getDescription());
state.setPublicationDate(ivyDescriptor.getPublicationDate());
Map<NamespaceId, String> extraInfo = Cast.uncheckedCast(ivyDescriptor.getExtraInfo());
state.getExtraInfo().putAll(extraInfo);
for (ExcludeRule excludeRule : ivyDescriptor.getAllExcludeRules()) {
addExcludeRule(state, excludeRule);
}
return state;
}
Aggregations