use of org.gradle.api.artifacts.ConfigurationVariant in project gradle by gradle.
the class ConfigurationVariantMapping method collectUsageContexts.
public void collectUsageContexts(final ImmutableCollection.Builder<UsageContext> outgoing) {
if (!outgoingConfiguration.isTransitive()) {
DeprecationLogger.warnOfChangedBehaviour("Publication ignores 'transitive = false' at configuration level.", "Consider using 'transitive = false' at the dependency level if you need this to be published.").withUserManual("publishing_ivy", "configurations_marked_as_non_transitive").nagUser();
}
Set<String> seen = Sets.newHashSet();
ConfigurationVariant defaultConfigurationVariant = instantiator.newInstance(DefaultConfigurationVariant.class, outgoingConfiguration);
ConfigurationVariantDetailsInternal details = instantiator.newInstance(DefaultConfigurationVariantDetails.class, defaultConfigurationVariant);
action.execute(details);
String outgoingConfigurationName = outgoingConfiguration.getName();
if (details.shouldPublish()) {
registerUsageContext(outgoing, seen, defaultConfigurationVariant, outgoingConfigurationName, details.getMavenScope(), details.isOptional());
}
NamedDomainObjectContainer<ConfigurationVariant> extraVariants = outgoingConfiguration.getOutgoing().getVariants();
for (ConfigurationVariant variant : extraVariants) {
details = new DefaultConfigurationVariantDetails(variant);
action.execute(details);
if (details.shouldPublish()) {
String name = outgoingConfigurationName + StringUtils.capitalize(variant.getName());
registerUsageContext(outgoing, seen, variant, name, details.getMavenScope(), details.isOptional());
}
}
}
Aggregations