Stay organized with collections Save and categorize content based on your preferences.

LibraryBuildType

interface LibraryBuildType : BuildType, LibraryVariantDimension


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.

There are two build types defined by default, debug and release, and you can customize them and create additional build types.

The default debug build type enables debug options, while the release build type is not debuggable and can be configured to, for example shrink and obfuscate your library for distribution.

See configuring build types for more information.

Summary

Public properties

Boolean

Whether this build type should be selected in Studio by default

Inherited functions

From class com.android.build.api.dsl.BuildType
Unit

Copies all properties from the given build type.

@Incubating Unit
Unit

This function is deprecated. Replaced with property matchingFallbacks

Unit
setMatchingFallbacks(vararg fallbacks: String)

This function is deprecated. Replaced with property matchingFallbacks

From class org.gradle.api.plugins.ExtensionAware
From class com.android.build.api.dsl.LibraryVariantDimension
Unit

Options for configuring AAR metadata.

@Incubating Any
consumerProguardFile(proguardFile: Any)

Adds a proguard rule file to be included in the published AAR.

@Incubating Any
consumerProguardFiles(vararg proguardFiles: Any)

Adds proguard rule files to be included in the published AAR.

From class org.gradle.api.Named
From class com.android.build.api.dsl.VariantDimension
Unit
addManifestPlaceholders(manifestPlaceholders: Map<StringAny>)

Adds manifest placeholders.

Unit
buildConfigField(type: String, name: String, value: String)

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 Unit
Any
proguardFile(proguardFile: Any)

Adds a new ProGuard configuration file.

Any
proguardFiles(vararg files: Any)

Adds new ProGuard configuration files.

Unit
resValue(type: String, name: String, value: String)

Adds a new generated resource.

Void?
setManifestPlaceholders(manifestPlaceholders: Map<StringAny>)

This function is deprecated. Use manifestPlaceholders property instead

Any
setProguardFiles(proguardFileIterable: Iterable<*>)

Replaces the ProGuard configuration files.

@Incubating Unit

Configure the shader compiler options.

Any
testProguardFile(proguardFile: Any)

Adds a proguard rule file to be used when processing test code.

Any
testProguardFiles(vararg proguardFiles: Any)

Adds proguard rule files to be used when processing test code.

Inherited properties

From class com.android.build.api.dsl.BuildType
Boolean

Specifies code coverage is enabled for module tests of type AndroidTest.

Boolean

Specifies unit test code coverage data collection by configuring the JacocoPlugin.

Boolean

Whether this build type is configured to generate an APK with debuggable native code.

Boolean

Specifies whether to enable code shrinking for this build type.

Boolean

Specifies whether the plugin should generate resources for pseudolocales.

Boolean

Whether the build type is configured to generate an apk with debuggable RenderScript code.

Boolean

Specifies whether to enable shrinking resources for this build type.

Boolean

This property is deprecated. Replaced with: enableUnitTestCoverage and or enableAndroidTestCoverage.

Boolean

This property is deprecated. Changing the value of isZipAlignEnabled no longer has any effect

MutableList<String>

Specifies a sorted list of build types that the plugin should try to use when a direct variant match with a local module dependency is not possible.

PostProcessing
Int

Optimization level to use by the renderscript compiler.

From class com.android.build.api.dsl.LibraryVariantDimension
AarMetadata

Options for configuring AAR metadata.

MutableList<File>

ProGuard rule files to be included in the published AAR.

Boolean?

Returns whether multi-dex is enabled.

ApkSigningConfig?

The associated signing config or null if none are set on the variant dimension.

From class com.android.build.api.dsl.VariantDimension
ExternalNativeBuildOptions

Encapsulates per-variant CMake and ndk-build configurations for your external native build.

JavaCompileOptions

Options for configuring Java compilation.

MutableMap<StringAny>

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.

Optimization
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 properties

isDefault

var isDefaultBoolean

Whether this build type should be selected in Studio by default