LibraryVariantDimension

Added in 4.2.0

interface LibraryVariantDimension : VariantDimension

Known direct subclasses
LibraryBaseFlavor

Shared properties between LibraryProductFlavor and LibraryDefaultConfig

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.

Known indirect subclasses
LibraryDefaultConfig

Specifies defaults for properties that the Android library plugin applies to all build variants.

LibraryProductFlavor

Encapsulates all product flavors properties for library projects.


Shared properties between DSL objects that contribute to a library variant.

That is, LibraryBuildType and LibraryProductFlavor and LibraryDefaultConfig.

Summary

Public functions

Unit
aarMetadata(action: AarMetadata.() -> Unit)

Options for configuring AAR metadata.

Any
consumerProguardFile(proguardFile: Any)

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

Any
consumerProguardFiles(vararg proguardFiles: Any)

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

Public properties

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.

Inherited functions

From 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.

Unit

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

Unit

Options for configuring Java compilation.

Unit
ndk(action: Ndk.() -> Unit)

Encapsulates per-variant configurations for the NDK, such as ABI filters.

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.

Unit
shaders(action: Shaders.() -> 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 com.android.build.api.dsl.VariantDimension
ExternalNativeBuildFlags

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 functions

aarMetadata

Added in 4.2.0
fun aarMetadata(action: AarMetadata.() -> Unit): Unit

Options for configuring AAR metadata.

consumerProguardFile

Added in 4.2.0
fun consumerProguardFile(proguardFile: Any): Any

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

This proguard rule file will then be used by any application project that consume the AAR (if proguard is enabled).

This allows AAR to specify shrinking or obfuscation exclude rules.

This is only valid for Library project. This is ignored in Application project.

This method has a return value for legacy reasons.

consumerProguardFiles

Added in 4.2.0
fun consumerProguardFiles(vararg proguardFiles: Any): Any

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

This proguard rule file will then be used by any application project that consume the AAR (if proguard is enabled).

This allows AAR to specify shrinking or obfuscation exclude rules.

This is only valid for Library project. This is ignored in Application project.

This method has a return value for legacy reasons.

Public properties

aarMetadata

Added in 4.2.0
val aarMetadataAarMetadata

Options for configuring AAR metadata.

consumerProguardFiles

Added in 4.2.0
val consumerProguardFilesMutableList<File>

ProGuard rule files to be included in the published AAR.

These proguard rule files will then be used by any application project that consumes the AAR (if ProGuard is enabled).

This allows AAR to specify shrinking or obfuscation exclude rules.

This is only valid for Library project. This is ignored in Application project.

multiDexEnabled

Added in 4.2.0
var multiDexEnabledBoolean?

Returns whether multi-dex is enabled.

This can be null if the flag is not set, in which case the default value is used.

signingConfig

Added in 4.2.0
var signingConfigApkSigningConfig?

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