use of org.gradle.api.internal.artifacts.configurations.OutgoingVariant in project gradle by gradle.
the class JvmLocalLibraryMetaDataAdapter method createResolvedMetaData.
private DefaultLibraryLocalComponentMetadata createResolvedMetaData(BinarySpecInternal selectedBinary, String projectPath, EnumMap<UsageKind, Iterable<DependencySpec>> dependenciesPerUsage, EnumMap<UsageKind, List<PublishArtifact>> artifacts) {
DefaultLibraryLocalComponentMetadata metadata = newResolvedLibraryMetadata(selectedBinary.getId(), toStringMap(dependenciesPerUsage), projectPath);
for (Map.Entry<UsageKind, List<PublishArtifact>> entry : artifacts.entrySet()) {
UsageKind usage = entry.getKey();
final List<PublishArtifact> publishArtifacts = entry.getValue();
metadata.addArtifacts(usage.getConfigurationName(), publishArtifacts);
metadata.addVariant(usage.getConfigurationName(), new OutgoingVariant() {
@Override
public AttributeContainerInternal getAttributes() {
return ImmutableAttributes.EMPTY;
}
@Override
public Set<? extends PublishArtifact> getArtifacts() {
return new LinkedHashSet<PublishArtifact>(publishArtifacts);
}
@Override
public Set<? extends OutgoingVariant> getChildren() {
return ImmutableSet.of();
}
});
}
return metadata;
}
use of org.gradle.api.internal.artifacts.configurations.OutgoingVariant in project gradle by gradle.
the class DefaultConfigurationComponentMetaDataBuilder method addConfigurations.
public void addConfigurations(BuildableLocalComponentMetadata metaData, Collection<? extends ConfigurationInternal> configurations) {
for (ConfigurationInternal configuration : configurations) {
addConfiguration(metaData, configuration);
dependenciesConverter.addDependencyDescriptors(metaData, configuration);
OutgoingVariant outgoingVariant = configuration.convertToOutgoingVariant();
metaData.addArtifacts(configuration.getName(), outgoingVariant.getArtifacts());
for (OutgoingVariant variant : outgoingVariant.getChildren()) {
metaData.addVariant(configuration.getName(), variant);
}
}
}
Aggregations