android-gradleConfigure Build Types


Parameters

ParameterDetail
applicationIdSuffixApplication id suffix applied to this base config
consumerProguardFilesProGuard rule files to be included in the published AAR
debuggableWhether this build type should generate a debuggable apk
embedMicroAppWhether a linked Android Wear app should be embedded in variant using this build type
jniDebuggableWhether this build type is configured to generate an APK with debuggable native code
manifestPlaceholdersThe manifest placeholders
minifyEnabledWhether Minify is enabled for this build type
multiDexEnabledWhether Multi-Dex is enabled for this variant
nameName of this build type
proguardFilesReturns ProGuard configuration files to be used
pseudoLocalesEnabledWhether to generate pseudo locale in the APK
renderscriptDebuggableWhether the build type is configured to generate an apk with debuggable RenderScript code
renderscriptOptimLevelOptimization level to use by the renderscript compiler
shrinkResourcesWhether shrinking of unused resources is enabled. Default is false
signingConfigThe signing configuration
testCoverageEnabledWhether test coverage is enabled for this build type
versionNameSuffixVersion name suffix
zipAlignEnabledWhether zipalign is enabled for this build type
--------------
MethodDetail
buildConfigField(type, name, value)Adds a new field to the generated BuildConfig class
consumerProguardFile(proguardFile)Adds a proguard rule file to be included in the published AAR
consumerProguardFiles(proguardFiles)Adds proguard rule files to be included in the published AAR
proguardFile(proguardFile)Adds a new ProGuard configuration file
proguardFiles(proguardFiles)Adds new ProGuard configuration files
resValue(type, name, value)Adds a new generated resource
resValue(type, name, value)Adds a new generated resource
setProguardFiles(proguardFileIterable)Sets the ProGuard configuration files
shrinkResources(flag)Whether shrinking of unused resources is enabled. Default is false

Remarks

By default, the Android plugin for gradle automatically sets up the project to build both a debug and a release version of the application.

This configuration is done through an object called a BuildType

Official Documentation:

http://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.BuildType.html