Package org.gradle.api.component
Schnittstelle AdhocComponentWithVariants
- Alle Superschnittstellen:
Named,SoftwareComponent
A component which can declare additional variants corresponding to
features. When published to Maven POMs, the dependencies of those variants
are exposed as optional dependencies. When published to Gradle metadata, the
variants are published as is.
- Seit:
- 5.3
-
Verschachtelte Klassen - Übersicht
Von Schnittstelle geerbte verschachtelte Klassen/Schnittstellen org.gradle.api.Named
Named.Namer -
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoidaddVariantsFromConfiguration(Configuration outgoingConfiguration, Action<? super ConfigurationVariantDetails> action) Declares an additional variant to publish, corresponding to an additional feature.voidwithVariantsFromConfiguration(Configuration outgoingConfiguration, Action<? super ConfigurationVariantDetails> action) Further configure previously declared variants.
-
Methodendetails
-
addVariantsFromConfiguration
void addVariantsFromConfiguration(Configuration outgoingConfiguration, Action<? super ConfigurationVariantDetails> action) Declares an additional variant to publish, corresponding to an additional feature.This can be used to determine if the variant should be published or not, and to configure various options specific to the publishing format.
- Parameter:
outgoingConfiguration- the configuration corresponding to the variant to use as source of dependencies and artifactsaction- action executed to configure the variant prior to publishing
-
withVariantsFromConfiguration
void withVariantsFromConfiguration(Configuration outgoingConfiguration, Action<? super ConfigurationVariantDetails> action) Further configure previously declared variants.The action can be used to determine if the variant should be published or not, and to configure various options specific to the publishing format. Note that if multiple actions are added, they are executed in the order they were added.
- Parameter:
outgoingConfiguration- the configuration corresponding to the variant to configure with a given actionaction- an additional action to be executed to configure the variant prior to publishing- Löst aus:
InvalidUserDataException- if the specified variant was not already added to this component
-