ApplicationProductFlavor
interface ApplicationProductFlavor : VariantDimension, HasInitWith, BaseFlavor, VariantDimension, ApplicationVariantDimension, ApplicationBaseFlavor, VariantDimension, HasInitWith, BaseFlavor, HasInitWith, ProductFlavor
Encapsulates all product flavors properties for application projects.
Product flavors represent different versions of your project that you expect to co-exist on a single device, the Google Play store, or repository. For example, you can configure 'demo' and 'full' product flavors for your app, and each of those flavors can specify different features, device requirements, resources, and application ID's--while sharing common source code and resources. So, product flavors allow you to output different versions of your project by simply changing only the components and settings that are different between them.
Configuring product flavors is similar to configuring build types: add them to the productFlavors
block of your project's build.gradle
file and configure the settings you want.
Product flavors support the same properties as the DefaultConfig
block—this is because defaultConfig
defines a ProductFlavor
object that the plugin uses as the base configuration for all other flavors. Each flavor you configure can then override any of the default values in defaultConfig
, such as the applicationId
.
When using Android plugin 3.0.0 and higher, each flavor must belong to a dimension
.
When you configure product flavors, the Android plugin automatically combines them with your BuildType
configurations to create build variants. If the plugin creates certain build variants that you don't want, you can filter variants using android.variantFilter
.
Summary
Public properties |
Boolean |
Whether this product flavor should be selected in Studio by default
|
Inherited functions |
From class ApplicationBaseFlavor
@Incubating Unit |
This function is deprecated. Replaced by maxSdk property
|
@Incubating Unit |
This function is deprecated. Replaced by targetSdkPreview property
|
@Incubating Unit |
This function is deprecated. Replaced by targetSdk property
|
@Incubating Unit |
This function is deprecated. Replaced by targetSdkPreview property
|
|
From class BaseFlavor
@Incubating String |
The name of the flavor.
|
@Incubating Unit |
Copies all properties from the given flavor.
|
@Incubating Unit |
This function is deprecated. Replaced by minSdk property
|
@Incubating Unit |
This function is deprecated. Replaced by minSdkPreview property
|
@Incubating Unit |
Specifies a flavor that the plugin should try to use from a given dimension in a dependency.
|
@Incubating Unit |
Specifies a sorted list of flavors that the plugin should try to use from a given dimension in a dependency.
|
@Incubating Unit |
Specifies a sorted list of flavors that the plugin should try to use from a given dimension in a dependency.
|
@Incubating Unit |
This function is deprecated. Replaced by resourceConfigurations field
|
@Incubating Unit |
This function is deprecated. Replaced by resourceConfigurations field
|
@Incubating Unit |
This function is deprecated. Replaced by resourceConfigurations field
|
@Incubating Unit |
This function is deprecated. Replaced by minSdk property
|
@Incubating Unit |
This function is deprecated. Replaced by minSdkPreview property
|
@Incubating Any? |
This function is deprecated. Replaced by testFunctionalTest property
|
@Incubating Any? |
This function is deprecated. Replaced by testFunctionalTest property
|
@Incubating Any? |
This function is deprecated. Replaced by testInstrumentationRunnerArguments property
|
@Incubating Unit |
This function is deprecated. Replaced by testInstrumentationRunnerArguments property
|
@Incubating Unit |
This function is deprecated. Replaced by testInstrumentationRunnerArguments property
|
@Incubating Unit |
Configures VectorDrawables .
|
|
From class ExtensionAware
|
From class ProductFlavor
@Incubating Void? |
This function is deprecated. Replaced with the dimension property
|
@Incubating Unit |
This function is deprecated. Replaced with property matchingFallbacks
|
@Incubating Unit |
This function is deprecated. Replaced with property matchingFallbacks
|
|
From class VariantDimension
@Incubating Unit |
Adds manifest placeholders.
|
@Incubating Unit |
Adds a new field to the generated BuildConfig class.
|
@Incubating Unit |
Encapsulates per-variant CMake and ndk-build configurations for your external native build.
|
Unit |
Options for configuring Java compilation.
|
@Incubating Unit |
Encapsulates per-variant configurations for the NDK, such as ABI filters.
|
@Incubating Any |
Adds a new ProGuard configuration file.
|
@Incubating Any |
Adds new ProGuard configuration files.
|
@Incubating Unit |
Adds a new generated resource.
|
@Incubating Void? |
This function is deprecated. Use manifestPlaceholders property instead
|
@Incubating Any |
Replaces the ProGuard configuration files.
|
@Incubating Unit |
Configure the shader compiler options.
|
@Incubating Any |
Adds a proguard rule file to be used when processing test code.
|
@Incubating Any |
Adds proguard rule files to be used when processing test code.
|
|
Public properties
isDefault
val isDefault: Boolean
Whether this product flavor should be selected in Studio by default