Search in sources :

Example 1 with IvyModuleArtifactPublishMetadata

use of org.gradle.internal.component.external.model.IvyModuleArtifactPublishMetadata in project gradle by gradle.

the class DefaultIvyDependencyPublisher method publish.

public void publish(List<ModuleVersionPublisher> publishResolvers, IvyModulePublishMetadata publishMetaData) {
    try {
        // Make a copy of the publication and filter missing artifacts
        DefaultIvyModulePublishMetadata publication = new DefaultIvyModulePublishMetadata(publishMetaData.getId(), publishMetaData.getModuleDescriptor());
        for (IvyModuleArtifactPublishMetadata artifact : publishMetaData.getArtifacts()) {
            addPublishedArtifact(artifact, publication);
        }
        for (ModuleVersionPublisher publisher : publishResolvers) {
            LOGGER.info("Publishing to {}", publisher);
            publisher.publish(publication);
        }
    } catch (IOException e) {
        throw new UncheckedIOException(e);
    }
}
Also used : DefaultIvyModulePublishMetadata(org.gradle.internal.component.external.model.DefaultIvyModulePublishMetadata) IvyModuleArtifactPublishMetadata(org.gradle.internal.component.external.model.IvyModuleArtifactPublishMetadata) UncheckedIOException(org.gradle.api.UncheckedIOException) IOException(java.io.IOException) UncheckedIOException(org.gradle.api.UncheckedIOException) ModuleVersionPublisher(org.gradle.api.internal.artifacts.ModuleVersionPublisher)

Example 2 with IvyModuleArtifactPublishMetadata

use of org.gradle.internal.component.external.model.IvyModuleArtifactPublishMetadata in project gradle by gradle.

the class IvyXmlModuleDescriptorWriter 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();
}
Also used : IvyModuleArtifactPublishMetadata(org.gradle.internal.component.external.model.IvyModuleArtifactPublishMetadata) IvyArtifactName(org.gradle.internal.component.model.IvyArtifactName)

Aggregations

IvyModuleArtifactPublishMetadata (org.gradle.internal.component.external.model.IvyModuleArtifactPublishMetadata)2 IOException (java.io.IOException)1 UncheckedIOException (org.gradle.api.UncheckedIOException)1 ModuleVersionPublisher (org.gradle.api.internal.artifacts.ModuleVersionPublisher)1 DefaultIvyModulePublishMetadata (org.gradle.internal.component.external.model.DefaultIvyModulePublishMetadata)1 IvyArtifactName (org.gradle.internal.component.model.IvyArtifactName)1