Package org.gradle.api.publish
Interface VersionMappingStrategy
-
public interface VersionMappingStrategyThe version mapping strategy for a publication. By default, Gradle will use the declared versions of a dependency directly. However in some situations it might be better to publish the resolved versions, or both when the metadata format supports it.- Since:
- 5.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidallVariants(Action<? super VariantVersionMappingStrategy> action)Configures the version mapping strategy for all variantsvoidusage(java.lang.String usage, Action<? super VariantVersionMappingStrategy> action)A short hand method to configure the variants which matches the provided Usage attribute.<T> voidvariant(Attribute<T> attribute, T attributeValue, Action<? super VariantVersionMappingStrategy> action)Configures the version mapping strategy for the variant which matches the provided attribute value.
-
-
-
Method Detail
-
allVariants
void allVariants(Action<? super VariantVersionMappingStrategy> action)
Configures the version mapping strategy for all variants- Parameters:
action- the configuration action
-
variant
<T> void variant(Attribute<T> attribute, T attributeValue, Action<? super VariantVersionMappingStrategy> action)
Configures the version mapping strategy for the variant which matches the provided attribute value.- Parameters:
attribute- the attribute to findattributeValue- the attribute valueaction- the configuration action
-
usage
void usage(java.lang.String usage, Action<? super VariantVersionMappingStrategy> action)A short hand method to configure the variants which matches the provided Usage attribute. This is the recommended way to configure the mapping strategy for the general case.- Parameters:
usage- the usage to look foraction- the configuration action
-
-