use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class AbstractMavenResolver method publish.
public void publish(IvyModulePublishMetadata moduleVersion) {
for (IvyModuleArtifactPublishMetadata artifactMetadata : moduleVersion.getArtifacts()) {
IvyArtifactName artifact = artifactMetadata.getArtifactName();
ModuleRevisionId moduleRevisionId = IvyUtil.createModuleRevisionId(artifactMetadata.getId().getComponentIdentifier());
Map<String, String> attributes = Collections.singletonMap("classifier", artifact.getClassifier());
Artifact ivyArtifact = new DefaultArtifact(moduleRevisionId, null, artifact.getName(), artifact.getType(), artifact.getExtension(), attributes);
collectArtifact(ivyArtifact, artifactMetadata.getFile());
}
publish();
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class AbstractRealisedModuleResolveMetadataSerializationHelper method readExcludeRule.
protected DefaultExclude readExcludeRule(Decoder decoder) throws IOException {
String moduleOrg = decoder.readString();
String moduleName = decoder.readString();
IvyArtifactName artifactName = readNullableArtifact(decoder);
String[] confs = readStringSet(decoder).toArray(new String[0]);
String matcher = decoder.readNullableString();
return new DefaultExclude(moduleIdentifierFactory.module(moduleOrg, moduleName), artifactName, confs, matcher);
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class AbstractRealisedModuleResolveMetadataSerializationHelper method readNullableArtifact.
@Nullable
protected IvyArtifactName readNullableArtifact(Decoder decoder) throws IOException {
boolean hasArtifact = decoder.readBoolean();
IvyArtifactName artifactName = null;
if (hasArtifact) {
String artifact = decoder.readString();
String type = decoder.readString();
String ext = decoder.readNullableString();
String classifier = decoder.readNullableString();
artifactName = new DefaultIvyArtifactName(artifact, type, ext, classifier);
}
return artifactName;
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class DefaultIvyModuleDescriptorWriter method printPublications.
private static void printPublications(Collection<IvyModuleArtifactPublishMetadata> artifacts, SimpleXmlWriter writer) throws IOException {
writer.startElement("publications");
for (IvyModuleArtifactPublishMetadata artifactMetadata : artifacts) {
IvyArtifactName artifact = artifactMetadata.getArtifactName();
writer.startElement("artifact");
writer.attribute("name", artifact.getName());
writer.attribute("type", artifact.getType());
writer.attribute("ext", artifact.getExtension() == null ? "" : artifact.getExtension());
writer.attribute("conf", Joiner.on(",").join(artifactMetadata.getConfigurations()));
if (artifact.getClassifier() != null) {
printExtraAttributes(Collections.singletonMap("m:classifier", artifact.getClassifier()), writer);
}
writer.endElement();
}
writer.endElement();
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class DefaultIvyModuleDescriptorWriter method printAllExcludes.
private static void printAllExcludes(IvyModulePublishMetadata metadata, SimpleXmlWriter writer) throws IOException {
for (Pair<ExcludeMetadata, String> excludePair : metadata.getExcludes()) {
ExcludeMetadata exclude = excludePair.getLeft();
writer.startElement("exclude");
writer.attribute("org", exclude.getModuleId().getGroup());
writer.attribute("module", exclude.getModuleId().getName());
IvyArtifactName artifact = exclude.getArtifact();
if (artifact != null) {
writer.attribute("artifact", artifact.getName());
writer.attribute("type", artifact.getType());
writer.attribute("ext", artifact.getExtension());
}
writer.attribute("conf", excludePair.getRight());
writer.endElement();
}
}
Aggregations