use of org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata in project gradle by gradle.
the class ExternalResourceResolver method getMetaDataArtifactFor.
private ModuleDescriptorArtifactMetadata getMetaDataArtifactFor(ModuleComponentIdentifier moduleComponentIdentifier) {
IvyArtifactName ivyArtifactName = getMetaDataArtifactName(moduleComponentIdentifier.getModule());
DefaultModuleComponentArtifactMetadata defaultModuleComponentArtifactMetadata = new DefaultModuleComponentArtifactMetadata(moduleComponentIdentifier, ivyArtifactName);
return new DefaultModuleDescriptorArtifactMetadata(defaultModuleComponentArtifactMetadata);
}
use of org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata in project gradle by gradle.
the class IvyConfigurationHelper method collectArtifactsFor.
private void collectArtifactsFor(String name, Collection<ModuleComponentArtifactMetadata> dest) {
for (Artifact artifact : artifactDefinitions) {
if (artifact.getConfigurations().contains(name)) {
ModuleComponentArtifactMetadata artifactMetadata = artifacts.get(artifact);
if (artifactMetadata == null) {
artifactMetadata = new DefaultModuleComponentArtifactMetadata(componentId, artifact.getArtifactName());
artifacts.put(artifact, artifactMetadata);
}
dest.add(artifactMetadata);
}
}
}
use of org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata in project gradle by gradle.
the class RealisedMavenModuleResolveMetadata method getArtifactsForConfiguration.
static ImmutableList<? extends ModuleComponentArtifactMetadata> getArtifactsForConfiguration(DefaultMavenModuleResolveMetadata metadata) {
ImmutableList<? extends ModuleComponentArtifactMetadata> artifacts;
if (metadata.isRelocated()) {
// relocated packages have no artifacts
artifacts = ImmutableList.of();
} else if (metadata.isPomPackaging()) {
// Modules with POM packaging _may_ have a jar
artifacts = ImmutableList.of(metadata.optionalArtifact("jar", "jar", null));
} else if (metadata.isKnownJarPackaging()) {
// Modules with a type of packaging that's always a jar
artifacts = ImmutableList.of(metadata.artifact("jar", "jar", null));
} else {
// Modules with other types of packaging may publish an artifact with that extension or a jar
String type = metadata.getPackaging();
artifacts = ImmutableList.of(new DefaultModuleComponentArtifactMetadata(metadata.getId(), new DefaultIvyArtifactName(metadata.getId().getModule(), type, type), metadata.artifact("jar", "jar", null)));
}
return artifacts;
}
use of org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata 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);
}
}
use of org.gradle.internal.component.external.model.DefaultModuleComponentArtifactMetadata in project gradle by gradle.
the class ComponentArtifactMetadataSerializer method read.
@Override
public ComponentArtifactMetadata read(Decoder decoder) throws Exception {
ModuleComponentIdentifier componentIdentifier = (ModuleComponentIdentifier) componentIdentifierSerializer.read(decoder);
String artifactName = decoder.readString();
String type = decoder.readString();
String extension = decoder.readNullableString();
String classifier = decoder.readNullableString();
return new DefaultModuleComponentArtifactMetadata(componentIdentifier, new DefaultIvyArtifactName(artifactName, type, extension, classifier));
}
Aggregations