# AdhocComponentWithVariants

interface AdhocComponentWithVariants : 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

## Functions

addVariantsFromConfiguration
Link copied to clipboard
abstract fun addVariantsFromConfiguration(outgoingConfiguration: Configuration, action: Action<in ConfigurationVariantDetails>)
@Incubating
abstract fun addVariantsFromConfiguration(outgoingConfiguration: Provider<ConsumableConfiguration>, action: Action<in ConfigurationVariantDetails>)
Declares an additional variant to publish, corresponding to an additional feature.
getName
Link copied to clipboard
abstract fun getName(): String
withVariantsFromConfiguration
Link copied to clipboard
abstract fun withVariantsFromConfiguration(outgoingConfiguration: Configuration, action: Action<in ConfigurationVariantDetails>)
@Incubating
abstract fun withVariantsFromConfiguration(outgoingConfiguration: Provider<ConsumableConfiguration>, action: Action<in ConfigurationVariantDetails>)
Further configure previously declared variants.