use of org.gradle.internal.component.external.descriptor.Artifact in project gradle by gradle.
the class RealisedIvyModuleResolveMetadataSerializationHelper method writeArtifacts.
private void writeArtifacts(Encoder encoder, List<Artifact> artifacts) throws IOException {
encoder.writeSmallInt(artifacts.size());
for (Artifact artifact : artifacts) {
IvyArtifactName artifactName = artifact.getArtifactName();
encoder.writeString(artifactName.getName());
encoder.writeString(artifactName.getType());
encoder.writeNullableString(artifactName.getExtension());
encoder.writeNullableString(artifactName.getClassifier());
writeStringSet(encoder, artifact.getConfigurations());
}
}
use of org.gradle.internal.component.external.descriptor.Artifact in project gradle by gradle.
the class RealisedIvyModuleResolveMetadataSerializationHelper method readIvyDependency.
private IvyDependencyDescriptor readIvyDependency(Decoder decoder) throws IOException {
ModuleComponentSelector requested = getComponentSelectorSerializer().read(decoder);
SetMultimap<String, String> configMappings = readDependencyConfigurationMapping(decoder);
List<Artifact> artifacts = readDependencyArtifactDescriptors(decoder);
List<Exclude> excludes = readDependencyExcludes(decoder);
String dynamicConstraintVersion = decoder.readString();
boolean changing = decoder.readBoolean();
boolean transitive = decoder.readBoolean();
boolean optional = decoder.readBoolean();
return new IvyDependencyDescriptor(requested, dynamicConstraintVersion, changing, transitive, optional, configMappings, artifacts, excludes);
}
use of org.gradle.internal.component.external.descriptor.Artifact 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.descriptor.Artifact in project gradle by gradle.
the class DefaultDependencyMetadata method getArtifacts.
@Override
public Set<ComponentArtifactMetadata> getArtifacts(ConfigurationMetadata fromConfiguration, ConfigurationMetadata toConfiguration) {
if (dependencyArtifacts.isEmpty()) {
return Collections.emptySet();
}
Set<String> includedConfigurations = fromConfiguration.getHierarchy();
Set<ComponentArtifactMetadata> artifacts = Sets.newLinkedHashSet();
for (Artifact depArtifact : dependencyArtifacts) {
IvyArtifactName ivyArtifactName = depArtifact.getArtifactName();
Set<String> artifactConfigurations = depArtifact.getConfigurations();
if (include(artifactConfigurations, includedConfigurations)) {
ComponentArtifactMetadata artifact = toConfiguration.artifact(ivyArtifactName);
artifacts.add(artifact);
}
}
return artifacts;
}
use of org.gradle.internal.component.external.descriptor.Artifact in project gradle by gradle.
the class DefaultIvyModuleResolveMetadata method collectArtifactsFor.
private void collectArtifactsFor(String name, Collection<ModuleComponentArtifactMetadata> dest) {
if (artifacts == null) {
artifacts = new IdentityHashMap<Artifact, ModuleComponentArtifactMetadata>();
}
for (Artifact artifact : artifactDefinitions) {
if (artifact.getConfigurations().contains(name)) {
ModuleComponentArtifactMetadata artifactMetadata = artifacts.get(artifact);
if (artifactMetadata == null) {
artifactMetadata = new DefaultModuleComponentArtifactMetadata(getId(), artifact.getArtifactName());
artifacts.put(artifact, artifactMetadata);
}
dest.add(artifactMetadata);
}
}
}
Aggregations