Package org.gradle.api.publish
Schnittstelle VersionMappingStrategy
public interface VersionMappingStrategy
The 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.
- Seit:
- 5.2
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidallVariants(Action<? super VariantVersionMappingStrategy> action) Configures the version mapping strategy for all variantsvoidusage(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.
-
Methodendetails
-
allVariants
Configures the version mapping strategy for all variants- Parameter:
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.- Parameter:
attribute- the attribute to findattributeValue- the attribute valueaction- the configuration action
-
usage
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.- Parameter:
usage- the usage to look foraction- the configuration action
-