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()
Specifies whether the plugin should generate resources for pseudolocales.
|
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, getManifestPlaceholders, getMultiDexEnabled, getMultiDexKeepFile, getMultiDexKeepProguard, getProguardFiles, getResValues, getTestProguardFiles, getVersionNameSuffix, setApplicationIdSuffix, setManifestPlaceholders, setMultiDexEnabled, setMultiDexKeepFile, setMultiDexKeepProguard, setVersionNameSuffixclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitgetApplicationIdSuffix, getBuildConfigFields, getConsumerProguardFiles, 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()
A pseudolocale is a locale that simulates characteristics of languages that cause UI, layout, and other translation-related problems when an app is localized. Pseudolocales can aid your development workflow because you can test and make adjustments to your UI before you finalize text for translation.
When you set this property to true as shown below, the plugin generates
resources for the following pseudo locales and makes them available in your connected
device's language preferences: en-XA and ar-XB.
android {
buildTypes {
debug {
pseudoLocalesEnabled true
}
}
}
When you build your app, the plugin includes the pseudolocale resources in your APK. If
you notice that your APK does not include those locale resources, make sure your build
configuration isn't limiting which locale resources are packaged with your APK, such as using
the resConfigs property to remove unused
locale resources.
To learn more, read Test Your App with Pseudolocales.
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