Package org.gradle.api.component
Interface AdhocComponentWithVariants
- All Superinterfaces:
- 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.
- Since:
- 5.3
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.gradle.api.NamedNamed.Namer
- 
Method SummaryModifier and TypeMethodDescriptionvoidaddVariantsFromConfiguration(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.
- 
Method Details- 
addVariantsFromConfigurationvoid 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. - Parameters:
- outgoingConfiguration- the configuration corresponding to the variant to use as source of dependencies and artifacts
- action- action executed to configure the variant prior to publishing
 
- 
withVariantsFromConfigurationvoid 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. - Parameters:
- outgoingConfiguration- the configuration corresponding to the variant to configure with a given action
- action- an additional action to be executed to configure the variant prior to publishing
- Throws:
- InvalidUserDataException- if the specified variant was not already added to this component
 
 
-