Search in sources :

Example 11 with Artifact

use of org.gradle.internal.component.external.descriptor.Artifact in project gradle by gradle.

the class IvyModuleResolveMetaDataBuilder method findOrCreate.

private Artifact findOrCreate(IvyArtifactName artifactName) {
    for (Artifact existingArtifact : artifacts) {
        if (existingArtifact.getArtifactName().equals(artifactName)) {
            return existingArtifact;
        }
    }
    Artifact newArtifact = new Artifact(artifactName);
    artifacts.add(newArtifact);
    return newArtifact;
}
Also used : Artifact(org.gradle.internal.component.external.descriptor.Artifact)

Example 12 with Artifact

use of org.gradle.internal.component.external.descriptor.Artifact in project gradle by gradle.

the class IvyModuleResolveMetaDataBuilder method addArtifact.

public void addArtifact(IvyArtifactName newArtifact, Set<String> configurations) {
    if (configurations.isEmpty()) {
        throw new IllegalArgumentException("Artifact should be attached to at least one configuration.");
    }
    Artifact artifact = findOrCreate(newArtifact);
    artifact.getConfigurations().addAll(configurations);
}
Also used : Artifact(org.gradle.internal.component.external.descriptor.Artifact)

Aggregations

Artifact (org.gradle.internal.component.external.descriptor.Artifact)12 IvyArtifactName (org.gradle.internal.component.model.IvyArtifactName)6 DefaultIvyArtifactName (org.gradle.internal.component.model.DefaultIvyArtifactName)4 DefaultExclude (org.gradle.internal.component.external.descriptor.DefaultExclude)3 Exclude (org.gradle.internal.component.model.Exclude)3 ImmutableList (com.google.common.collect.ImmutableList)2 List (java.util.List)2 Map (java.util.Map)2 DependencyArtifactDescriptor (org.apache.ivy.core.module.descriptor.DependencyArtifactDescriptor)2 ExcludeRule (org.apache.ivy.core.module.descriptor.ExcludeRule)2 ModuleRevisionId (org.apache.ivy.core.module.id.ModuleRevisionId)2 ModuleComponentSelector (org.gradle.api.artifacts.component.ModuleComponentSelector)2 ModuleVersionSelector (org.gradle.api.artifacts.ModuleVersionSelector)1 DefaultModuleVersionSelector (org.gradle.api.internal.artifacts.DefaultModuleVersionSelector)1 DefaultImmutableVersionConstraint (org.gradle.api.internal.artifacts.dependencies.DefaultImmutableVersionConstraint)1 DefaultModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata)1 DefaultModuleComponentSelector (org.gradle.internal.component.external.model.DefaultModuleComponentSelector)1 IvyDependencyMetadata (org.gradle.internal.component.external.model.IvyDependencyMetadata)1 ModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata)1 IvyDependencyDescriptor (org.gradle.internal.component.external.model.ivy.IvyDependencyDescriptor)1