use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class AbstractIvyDependencyDescriptorFactory method convertArtifacts.
protected List<IvyArtifactName> convertArtifacts(Set<DependencyArtifact> dependencyArtifacts) {
if (dependencyArtifacts.isEmpty()) {
return Collections.emptyList();
}
ImmutableList.Builder<IvyArtifactName> names = ImmutableList.builder();
for (DependencyArtifact dependencyArtifact : dependencyArtifacts) {
DefaultIvyArtifactName name = new DefaultIvyArtifactName(dependencyArtifact.getName(), dependencyArtifact.getType(), getExtension(dependencyArtifact), dependencyArtifact.getClassifier());
names.add(name);
}
return names.build();
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class ComponentArtifactIdentifierSerializer method write.
@Override
public void write(Encoder encoder, DefaultModuleComponentArtifactIdentifier value) throws Exception {
componentIdentifierSerializer.write(encoder, value.getComponentIdentifier());
IvyArtifactName ivyArtifactName = value.getName();
encoder.writeString(ivyArtifactName.getName());
encoder.writeString(ivyArtifactName.getType());
encoder.writeNullableString(ivyArtifactName.getExtension());
encoder.writeNullableString(ivyArtifactName.getClassifier());
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class MavenLocalPomMetadataSource method listModuleVersions.
@Override
public void listModuleVersions(ModuleDependencyMetadata dependency, ModuleIdentifier module, List<ResourcePattern> ivyPatterns, List<ResourcePattern> artifactPatterns, VersionLister versionLister, BuildableModuleVersionListingResolveResult result) {
IvyArtifactName dependencyArtifact = getPrimaryDependencyArtifact(dependency);
versionLister.listVersions(module, dependencyArtifact, artifactPatterns, result);
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class AbstractResourcePattern method isComplete.
@Override
public boolean isComplete(ModuleComponentArtifactMetadata artifactIdentifier) {
IvyArtifactName artifactName = artifactIdentifier.getName();
ModuleComponentIdentifier componentIdentifier = artifactIdentifier.getId().getComponentIdentifier();
return isValidSubstitute(componentIdentifier.getModule(), false) && isValidSubstitute(componentIdentifier.getGroup(), organisationIsOptional) && isValidSubstitute(componentIdentifier.getVersion(), revisionIsOptional) && isValidSubstitute(artifactName.getName(), artifactIsOptional) && isValidSubstitute(artifactName.getClassifier(), classifierIsOptional) && isValidSubstitute(artifactName.getExtension(), extensionIsOptional) && isValidSubstitute(artifactName.getType(), typeIsOptional);
}
use of org.gradle.internal.component.model.IvyArtifactName in project gradle by gradle.
the class DefaultArtifactPublisher method publish.
@Override
public void publish(final Iterable<? extends PublicationAwareRepository> repositories, final Module module, final Configuration configuration, final File descriptor) throws PublishException {
Set<ConfigurationInternal> allConfigurations = Cast.uncheckedCast(configuration.getAll());
Set<ConfigurationInternal> configurationsToPublish = Cast.uncheckedCast(configuration.getHierarchy());
// Will create `ivy.xml` even for Maven publishing! (as long as `Upload.uploadDescriptor == true`)
if (descriptor != null) {
// Convert once, in order to write the Ivy descriptor with _all_ configurations
DefaultIvyModulePublishMetadata publishMetaData = toPublishMetaData(module, allConfigurations, false);
ivyModuleDescriptorWriter.write(publishMetaData, descriptor);
}
// Convert a second time with only the published configurations: this ensures that the correct artifacts are included
DefaultIvyModulePublishMetadata publishMetaData = toPublishMetaData(module, configurationsToPublish, true);
if (descriptor != null) {
IvyArtifactName artifact = new DefaultIvyArtifactName("ivy", "ivy", "xml");
publishMetaData.addArtifact(artifact, descriptor);
}
for (PublicationAwareRepository repository : repositories) {
ModuleVersionPublisher publisher = repository.createPublisher();
LOGGER.info("Publishing to {}", publisher);
publisher.publish(publishMetaData);
}
}
Aggregations