VariantDimension
interface VariantDimension
ApplicationVariantDimension |
Shared properties between DSL objects that contribute to an application variant. |
BaseFlavor |
Shared properties between DSL objects |
BuildType |
Build types define certain properties that Gradle uses when building and packaging your app, and are typically configured for different stages of your development lifecycle. |
DynamicFeatureVariantDimension |
Shared properties between DSL objects that contribute to an dynamic feature variant. |
LibraryVariantDimension |
Shared properties between DSL objects that contribute to a library variant. |
TestVariantDimension |
Shared properties between DSL objects that contribute to a separate-test-project variant. |
ApplicationBaseFlavor |
|
ApplicationBuildType |
Build types define certain properties that Gradle uses when building and packaging your app, and are typically configured for different stages of your development lifecycle. |
ApplicationDefaultConfig |
Specifies defaults for properties that the Android application plugin applies to all build variants. |
ApplicationProductFlavor |
Encapsulates all product flavors properties for application projects. |
DefaultConfig |
Specifies defaults for variant properties that the Android plugin applies to all build variants. |
DynamicFeatureBaseFlavor |
Shared properties between DSL objects |
DynamicFeatureBuildType |
Build types define certain properties that Gradle uses when building and packaging your app, and are typically configured for different stages of your development lifecycle. |
DynamicFeatureDefaultConfig |
Specifies defaults for properties that the Android dynamic-feature plugin applies to all build variants. |
DynamicFeatureProductFlavor |
Encapsulates all product flavors properties for dynamic feature projects. |
LibraryBaseFlavor |
|
LibraryBuildType |
Build types define certain properties that Gradle uses when building and packaging your library, and are typically configured for different stages of your development lifecycle. |
LibraryDefaultConfig |
Specifies defaults for properties that the Android library plugin applies to all build variants. |
LibraryProductFlavor |
Encapsulates all product flavors properties for library projects. |
ProductFlavor |
Encapsulates all product flavors properties for this project. |
TestBaseFlavor |
|
TestBuildType |
Build types define certain properties that Gradle uses when building and packaging your library, and are typically configured for different stages of your development lifecycle. |
TestDefaultConfig |
Specifies defaults for properties that the Android test plugin applies to all build variants. |
TestProductFlavor |
Encapsulates all product flavors properties for test projects. |
Shared properties between DSL objects that contribute to a variant.
That is, BuildType
and ProductFlavor
and DefaultConfig
.
Summary
Public functions |
|
---|---|
@Incubating Unit |
addManifestPlaceholders(manifestPlaceholders: Map<String?, Any?>?) Adds manifest placeholders. |
@Incubating Unit |
buildConfigField(type: String?, name: String?, value: String?) Adds a new field to the generated BuildConfig class. |
@Incubating Unit |
externalNativeBuild(action: (@ExtensionFunctionType ExternalNativeBuildOptions.() -> Unit)?) Encapsulates per-variant CMake and ndk-build configurations for your external native build. |
Unit |
javaCompileOptions(action: (@ExtensionFunctionType JavaCompileOptions.() -> Unit)?) Options for configuring Java compilation. |
@Incubating Unit |
ndk(action: (@ExtensionFunctionType Ndk.() -> Unit)?) Encapsulates per-variant configurations for the NDK, such as ABI filters. |
@Incubating Any |
proguardFile(proguardFile: Any?) Adds a new ProGuard configuration file. |
@Incubating Any |
proguardFiles(vararg files: 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 |
setProguardFiles(proguardFileIterable: Iterable<*>?) Replaces the ProGuard configuration files. |
@Incubating Unit |
shaders(action: (@ExtensionFunctionType Shaders.() -> Unit)?) Configure the shader compiler options. |
@Incubating Any |
testProguardFile(proguardFile: Any?) Adds a proguard rule file to be used when processing test code. |
@Incubating Any |
testProguardFiles(vararg proguardFiles: Any?) Adds proguard rule files to be used when processing test code. |
Public properties |
|
---|---|
ExternalNativeBuildOptions |
Encapsulates per-variant CMake and ndk-build configurations for your external native build. |
JavaCompileOptions |
Options for configuring Java compilation. |
MutableMap<String, Any> |
The manifest placeholders. |
File? |
This property is deprecated. This property is deprecated. |
File? |
Text file with additional ProGuard rules to be used to determine which classes are compiled into the main dex file. |
Ndk |
Encapsulates per-variant configurations for the NDK, such as ABI filters. |
MutableList<File> |
Specifies the ProGuard configuration files that the plugin should use. |
Shaders |
Options for configuring the shader compiler. |
MutableList<File> |
The collection of proguard rule files to be used when processing test code. |
Public functions
addManifestPlaceholders
@Incubating
fun addManifestPlaceholders(manifestPlaceholders: Map<String?, Any?>?): Unit
Adds manifest placeholders.
buildConfigField
@Incubating
fun buildConfigField(type: String?, name: String?, value: String?): Unit
Adds a new field to the generated BuildConfig class.
The field is generated as: <type> <name> = <value>;
This means each of these must have valid Java content. If the type is a String, then the value should include quotes.
externalNativeBuild
@Incubating
fun externalNativeBuild(action: (@ExtensionFunctionType ExternalNativeBuildOptions.() -> Unit)?): Unit
Encapsulates per-variant CMake and ndk-build configurations for your external native build.
To learn more, see Add C and C++ Code to Your Project.
javaCompileOptions
fun javaCompileOptions(action: (@ExtensionFunctionType JavaCompileOptions.() -> Unit)?): Unit
Options for configuring Java compilation.
ndk
@Incubating
fun ndk(action: (@ExtensionFunctionType Ndk.() -> Unit)?): Unit
Encapsulates per-variant configurations for the NDK, such as ABI filters.
proguardFile
@Incubating
fun proguardFile(proguardFile: Any?): Any
Adds a new ProGuard configuration file.
proguardFile getDefaultProguardFile('proguard-android.txt')
There are two ProGuard rules files that ship with the Android plugin and are used by default:
-
proguard-android.txt
-
proguard-android-optimize.txt
proguard-android-optimize.txt
is identical to proguard-android.txt
, except with optimizations enabled. You can use getDefaultProguardFile(String) to return the full path of the files.
This method has a return value for legacy reasons.
proguardFiles
@Incubating
fun proguardFiles(vararg files: Any?): Any
Adds new ProGuard configuration files.
There are two ProGuard rules files that ship with the Android plugin and are used by default:
-
proguard-android.txt
-
proguard-android-optimize.txt
proguard-android-optimize.txt
is identical to proguard-android.txt
, except with optimizations enabled. You can use getDefaultProguardFile(String) to return the full path of the files.
This method has a return value for legacy reasons.
resValue
@Incubating
fun resValue(type: String?, name: String?, value: String?): Unit
Adds a new generated resource.
This is equivalent to specifying a resource in res/values.
See Resource Types.
setManifestPlaceholders
@Incubating
funsetManifestPlaceholders(manifestPlaceholders: Map<String?, Any?>?): Void?
setProguardFiles
@Incubating
fun setProguardFiles(proguardFileIterable: Iterable<*>?): Any
Replaces the ProGuard configuration files.
This method has a return value for legacy reasons.
shaders
@Incubating
fun shaders(action: (@ExtensionFunctionType Shaders.() -> Unit)?): Unit
Configure the shader compiler options.
testProguardFile
@Incubating
fun testProguardFile(proguardFile: Any?): Any
Adds a proguard rule file to be used when processing test code.
Test code needs to be processed to apply the same obfuscation as was done to main code.
This method has a return value for legacy reasons.
testProguardFiles
@Incubating
fun testProguardFiles(vararg proguardFiles: Any?): Any
Adds proguard rule files to be used when processing test code.
Test code needs to be processed to apply the same obfuscation as was done to main code.
This method has a return value for legacy reasons.
Public properties
externalNativeBuild
val externalNativeBuild: ExternalNativeBuildOptions
Encapsulates per-variant CMake and ndk-build configurations for your external native build.
To learn more, see Add C and C++ Code to Your Project.
javaCompileOptions
val javaCompileOptions: JavaCompileOptions
Options for configuring Java compilation.
multiDexKeepFile
val multiDexKeepFile: File?
Text file that specifies additional classes that will be compiled into the main dex file.
Classes specified in the file are appended to the main dex classes computed using aapt
.
If set, the file should contain one class per line, in the following format: com/example/MyClass.class
multiDexKeepProguard
val multiDexKeepProguard: File?
Text file with additional ProGuard rules to be used to determine which classes are compiled into the main dex file.
If set, rules from this file are used in combination with the default rules used by the build system.
proguardFiles
val proguardFiles: MutableList<File>
Specifies the ProGuard configuration files that the plugin should use.
There are two ProGuard rules files that ship with the Android plugin and are used by default:
-
proguard-android.txt
-
proguard-android-optimize.txt
proguard-android-optimize.txt
is identical to proguard-android.txt
, except with optimizations enabled. You can use getDefaultProguardFile(String) to return the full path of the files.
Returns | |
---|---|
MutableList<File> |
a non-null collection of files. |
testProguardFiles
val testProguardFiles: MutableList<File>
The collection of proguard rule files to be used when processing test code.
Test code needs to be processed to apply the same obfuscation as was done to main code.