public class DefaultBuildType
extends com.android.builder.internal.BaseConfigImpl
implements com.android.builder.model.BuildType
| Constructor and Description |
|---|
DefaultBuildType(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getName()
Name of this build type.
|
int |
getRenderscriptOptimLevel()
Optimization level to use by the renderscript compiler.
|
com.android.builder.model.SigningConfig |
getSigningConfig()
Sets the signing configuration.
|
DefaultBuildType |
initWith(com.android.builder.model.BuildType that)
Copies all properties from the given build type.
|
boolean |
isDebuggable()
Whether this build type should generate a debuggable apk.
|
boolean |
isEmbedMicroApp()
Whether a linked Android Wear app should be embedded in variant using this build type.
|
boolean |
isJniDebuggable()
Whether this build type is configured to generate an APK with debuggable native code.
|
boolean |
isMinifyEnabled()
Whether Minify is enabled for this build type.
|
boolean |
isPseudoLocalesEnabled()
Whether to generate pseudo locale in the APK.
|
boolean |
isRenderscriptDebuggable()
Whether the build type is configured to generate an apk with debuggable RenderScript code.
|
boolean |
isTestCoverageEnabled()
Whether test coverage is enabled for this build type.
|
boolean |
isZipAlignEnabled()
Whether zipalign is enabled for this build type.
|
com.android.builder.model.BuildType |
setDebuggable(boolean debuggable)
Whether this build type should generate a debuggable apk.
|
void |
setEmbedMicroApp(boolean embedMicroApp) |
com.android.builder.model.BuildType |
setJniDebuggable(boolean jniDebugBuild)
Whether this build type is configured to generate an APK with debuggable native code.
|
com.android.builder.model.BuildType |
setMinifyEnabled(boolean enabled)
Whether Minify is enabled for this build type.
|
void |
setPseudoLocalesEnabled(boolean pseudoLocalesEnabled) |
com.android.builder.model.BuildType |
setRenderscriptDebuggable(boolean renderscriptDebugBuild)
Whether the build type is configured to generate an apk with debuggable RenderScript code.
|
void |
setRenderscriptOptimLevel(int renderscriptOptimLevel)
Optimization level to use by the renderscript compiler.
|
com.android.builder.model.BuildType |
setSigningConfig(com.android.builder.model.SigningConfig signingConfig)
Sets the signing configuration.
|
void |
setTestCoverageEnabled(boolean testCoverageEnabled) |
com.android.builder.model.BuildType |
setZipAlignEnabled(boolean zipAlign)
Whether zipalign is enabled for this build type.
|
java.lang.String |
toString() |
_initWith, addBuildConfigField, addBuildConfigFields, addManifestPlaceholders, addResValue, addResValues, getApplicationIdSuffix, getBuildConfigFields, getConsumerProguardFiles, getJarJarRuleFiles, getManifestPlaceholders, getMultiDexEnabled, getMultiDexKeepFile, getMultiDexKeepProguard, getProguardFiles, getResValues, getTestProguardFiles, getVersionNameSuffix, setApplicationIdSuffix, setJarJarRuleFiles, setManifestPlaceholders, setMultiDexEnabled, setMultiDexKeepFile, setMultiDexKeepProguard, setVersionNameSuffixclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetApplicationIdSuffix, getBuildConfigFields, getConsumerProguardFiles, getJarJarRuleFiles, getManifestPlaceholders, getMultiDexEnabled, getMultiDexKeepFile, getMultiDexKeepProguard, getProguardFiles, getResValues, getTestProguardFiles, getVersionNameSuffixpublic DefaultBuildType initWith(com.android.builder.model.BuildType that)
It can be used like this:
android.buildTypes {
customBuildType {
initWith debug
// customize...
}
}
@NonNull public java.lang.String getName()
getName in interface com.android.builder.model.BaseConfiggetName in interface com.android.builder.model.BuildType@NonNull public com.android.builder.model.BuildType setDebuggable(boolean debuggable)
public boolean isDebuggable()
isDebuggable in interface com.android.builder.model.BuildTypepublic void setTestCoverageEnabled(boolean testCoverageEnabled)
public boolean isTestCoverageEnabled()
If enabled this uses Jacoco to capture coverage and creates a report in the build directory.
The version of Jacoco can be configured with:
android {
jacoco {
version = '0.6.2.201302030002'
}
}
isTestCoverageEnabled in interface com.android.builder.model.BuildTypepublic void setPseudoLocalesEnabled(boolean pseudoLocalesEnabled)
public boolean isPseudoLocalesEnabled()
If enabled, 2 fake pseudo locales (en-XA and ar-XB) will be added to the APK to help test internationalization support in the app.
isPseudoLocalesEnabled in interface com.android.builder.model.BuildType@NonNull public com.android.builder.model.BuildType setJniDebuggable(boolean jniDebugBuild)
public boolean isJniDebuggable()
isJniDebuggable in interface com.android.builder.model.BuildTypepublic boolean isRenderscriptDebuggable()
isRenderscriptDebuggable in interface com.android.builder.model.BuildTypepublic com.android.builder.model.BuildType setRenderscriptDebuggable(boolean renderscriptDebugBuild)
public int getRenderscriptOptimLevel()
getRenderscriptOptimLevel in interface com.android.builder.model.BuildTypepublic void setRenderscriptOptimLevel(int renderscriptOptimLevel)
@NonNull public com.android.builder.model.BuildType setMinifyEnabled(boolean enabled)
public boolean isMinifyEnabled()
isMinifyEnabled in interface com.android.builder.model.BuildType@NonNull public com.android.builder.model.BuildType setZipAlignEnabled(boolean zipAlign)
public boolean isZipAlignEnabled()
isZipAlignEnabled in interface com.android.builder.model.BuildType@NonNull
public com.android.builder.model.BuildType setSigningConfig(@Nullable
com.android.builder.model.SigningConfig signingConfig)
signingConfig signingConfigs.myConfig@Nullable public com.android.builder.model.SigningConfig getSigningConfig()
signingConfig signingConfigs.myConfiggetSigningConfig in interface com.android.builder.model.BuildTypepublic boolean isEmbedMicroApp()
Wear apps can be linked with the following code:
dependencies {
freeWearApp project(:wear:free') // applies to variant using the free flavor
wearApp project(':wear:base') // applies to all other variants
}
isEmbedMicroApp in interface com.android.builder.model.BuildTypepublic void setEmbedMicroApp(boolean embedMicroApp)
@NonNull public java.lang.String toString()
toString in class com.android.builder.internal.BaseConfigImpl