Search in sources :

Example 1 with DefaultIvyArtifactRepository

use of org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository in project gradle by gradle.

the class DependencyResolverIvyPublisher method publish.

@Override
public void publish(IvyNormalizedPublication publication, IvyArtifactRepository repository) {
    IvyResolver publisher = ((DefaultIvyArtifactRepository) repository).createPublisher();
    IvyPublicationIdentity projectIdentity = publication.getProjectIdentity();
    ModuleComponentIdentifier moduleVersionIdentifier = DefaultModuleComponentIdentifier.newId(DefaultModuleIdentifier.newId(projectIdentity.getOrganisation(), projectIdentity.getModule()), projectIdentity.getRevision());
    for (IvyArtifact artifact : publication.getAllArtifacts()) {
        ModuleComponentArtifactMetadata artifactMetadata = new DefaultModuleComponentArtifactMetadata(moduleVersionIdentifier, createIvyArtifact(artifact));
        publish(publisher, artifact, artifactMetadata);
    }
}
Also used : DefaultIvyArtifactRepository(org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository) ModuleComponentIdentifier(org.gradle.api.artifacts.component.ModuleComponentIdentifier) DefaultModuleComponentIdentifier(org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier) DefaultModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata) IvyResolver(org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver) ModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata) DefaultModuleComponentArtifactMetadata(org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata) IvyArtifact(org.gradle.api.publish.ivy.IvyArtifact)

Example 2 with DefaultIvyArtifactRepository

use of org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository in project gradle by gradle.

the class IvyPublishPlugin method hasStandardPattern.

private boolean hasStandardPattern(IvyArtifactRepository ivyArtifactRepository) {
    DefaultIvyArtifactRepository repo = (DefaultIvyArtifactRepository) ivyArtifactRepository;
    RepositoryDescriptor descriptor = repo.getDescriptor();
    if (descriptor instanceof IvyRepositoryDescriptor) {
        IvyRepositoryDescriptor desc = (IvyRepositoryDescriptor) descriptor;
        List<String> artifactPatterns = desc.getArtifactPatterns();
        if (artifactPatterns.size() == 1) {
            return artifactPatterns.get(0).equals(IvyArtifactRepository.GRADLE_ARTIFACT_PATTERN);
        } else {
            return false;
        }
    }
    return true;
}
Also used : DefaultIvyArtifactRepository(org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository) IvyRepositoryDescriptor(org.gradle.api.internal.artifacts.repositories.descriptor.IvyRepositoryDescriptor) RepositoryDescriptor(org.gradle.api.internal.artifacts.repositories.descriptor.RepositoryDescriptor) IvyRepositoryDescriptor(org.gradle.api.internal.artifacts.repositories.descriptor.IvyRepositoryDescriptor)

Aggregations

DefaultIvyArtifactRepository (org.gradle.api.internal.artifacts.repositories.DefaultIvyArtifactRepository)2 ModuleComponentIdentifier (org.gradle.api.artifacts.component.ModuleComponentIdentifier)1 IvyRepositoryDescriptor (org.gradle.api.internal.artifacts.repositories.descriptor.IvyRepositoryDescriptor)1 RepositoryDescriptor (org.gradle.api.internal.artifacts.repositories.descriptor.RepositoryDescriptor)1 IvyResolver (org.gradle.api.internal.artifacts.repositories.resolver.IvyResolver)1 IvyArtifact (org.gradle.api.publish.ivy.IvyArtifact)1 DefaultModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata)1 DefaultModuleComponentIdentifier (org.gradle.internal.component.external.model.DefaultModuleComponentIdentifier)1 ModuleComponentArtifactMetadata (org.gradle.internal.component.external.model.ModuleComponentArtifactMetadata)1