Variant

@Incubating interface Variant<PropertiesT : VariantProperties> : Component<PropertiesT>, ActionableComponentObject
ApplicationVariant

Application specific variant object that contains properties that will determine the variant's build flow.

DynamicFeatureVariant

LibraryVariant

Variant type for library projects

TestVariant

Variant type for tests associated with a module.

Variant object that contains properties that must be set during configuration time as it changes the build flow for the variant.

Summary

Public methods

abstract Unit

abstract Unit

abstract Unit

abstract Unit

Inherited functions

Unit onProperties(action: PropertiesT.() -> Unit)

Runs the Action block on the VariantProperties object once created.

Properties

abstract Int

Inherited properties

String? buildType

Build Type name, might be replaced with access to locked DSL object once ready

String flavorName

The multi-flavor name of the variant.

This does not include the build type. If no flavors are present, this is an empty string.

The full name of the variant is queried via getName

List<Pair<String, String>> productFlavors

List of flavor names, might be replaced with access to locked DSL objects once ready

The order is properly sorted based on the associated dimension order

Boolean enabled

Set to True if the variant is active and should be configured, false otherwise.

Public methods

androidTest

abstract fun androidTest(action: AndroidTest<AndroidTestProperties>.() -> Unit): Unit

androidTestProperties

abstract fun androidTestProperties(action: AndroidTestProperties.() -> Unit): Unit

unitTest

abstract fun unitTest(action: UnitTest<UnitTestProperties>.() -> Unit): Unit

unitTestProperties

abstract fun unitTestProperties(action: UnitTestProperties.() -> Unit): Unit

Properties

minSdkVersion

abstract var minSdkVersion: Int