Interface AdhocComponentWithVariants

All Superinterfaces:
Named, SoftwareComponent

@Incubating public interface AdhocComponentWithVariants extends 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
  • Method Details

    • addVariantsFromConfiguration

      void addVariantsFromConfiguration(Configuration outgoingConfiguration, Action<? super ConfigurationVariantDetails> action)
      Declares an additional variant to publish, corresponding to an additional feature.
      Parameters:
      outgoingConfiguration - the configuration corresponding to the variant to use as source of dependencies and artifacts
      action - the action to execute in order to determine if a configuration variant should be published or not