Search in sources :

Example 1 with PublishArtifactSet

use of org.gradle.api.artifacts.PublishArtifactSet in project gradle by gradle.

the class DefaultConfigurationPublications method convertToOutgoingVariant.

public OutgoingVariant convertToOutgoingVariant() {
    return new OutgoingVariant() {

        @Override
        public DisplayName asDescribable() {
            return displayName;
        }

        @Override
        public AttributeContainerInternal getAttributes() {
            return attributes;
        }

        @Override
        public Set<? extends PublishArtifact> getArtifacts() {
            return artifacts;
        }

        @Override
        public Set<? extends OutgoingVariant> getChildren() {
            Set<OutgoingVariant> result = new LinkedHashSet<OutgoingVariant>();
            PublishArtifactSet allArtifactSet = allArtifacts.getPublishArtifactSet();
            if (allArtifactSet.size() > 0 || variants == null) {
                result.add(new LeafOutgoingVariant(displayName, attributes, allArtifactSet));
            }
            if (variants != null) {
                for (DefaultVariant variant : variants.withType(DefaultVariant.class)) {
                    result.add(variant.convertToOutgoingVariant());
                }
            }
            return result;
        }
    };
}
Also used : LinkedHashSet(java.util.LinkedHashSet) PublishArtifactSet(org.gradle.api.artifacts.PublishArtifactSet)

Example 2 with PublishArtifactSet

use of org.gradle.api.artifacts.PublishArtifactSet in project build-info by JFrogDev.

the class TaskHelperConfigurations method getArtifactDeployDetails.

protected Set<GradleDeployDetails> getArtifactDeployDetails() {
    Set<GradleDeployDetails> deployDetails = Sets.newLinkedHashSet();
    if (!hasConfigurations()) {
        log.info("No configurations to publish for project '{}'.", getProject().getPath());
        return deployDetails;
    }
    Set<String> processedFiles = Sets.newHashSet();
    for (Configuration configuration : publishConfigurations) {
        PublishArtifactSet artifacts = configuration.getAllArtifacts();
        for (PublishArtifact artifact : artifacts) {
            GradleDeployDetails gdd = gradleDeployDetails(artifact, configuration.getName(), processedFiles);
            if (gdd != null) {
                deployDetails.add(gdd);
            }
        }
    }
    return deployDetails;
}
Also used : Configuration(org.gradle.api.artifacts.Configuration) ArtifactoryClientConfiguration(org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration) PublishArtifactSet(org.gradle.api.artifacts.PublishArtifactSet) PublishArtifact(org.gradle.api.artifacts.PublishArtifact) GradleDeployDetails(org.jfrog.gradle.plugin.artifactory.extractor.GradleDeployDetails)

Aggregations

PublishArtifactSet (org.gradle.api.artifacts.PublishArtifactSet)2 LinkedHashSet (java.util.LinkedHashSet)1 Configuration (org.gradle.api.artifacts.Configuration)1 PublishArtifact (org.gradle.api.artifacts.PublishArtifact)1 ArtifactoryClientConfiguration (org.jfrog.build.extractor.clientConfiguration.ArtifactoryClientConfiguration)1 GradleDeployDetails (org.jfrog.gradle.plugin.artifactory.extractor.GradleDeployDetails)1