For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

AdhocComponentWithVariants

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

Link copied to clipboard
abstract fun addVariantsFromConfiguration(outgoingConfiguration: Configuration, action: Action<in ConfigurationVariantDetails>)
Declares an additional variant to publish, corresponding to an additional feature.
Link copied to clipboard
abstract fun getName(): String
The object's name.
Link copied to clipboard
abstract fun withVariantsFromConfiguration(outgoingConfiguration: Configuration, action: Action<in ConfigurationVariantDetails>)
Further configure previously declared variants.