LibraryVariantDimension

public interface LibraryVariantDimension extends VariantDimension

Known direct subclasses
LibraryBaseFlavor
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 methods

abstract void

Options for configuring AAR metadata.

abstract @NonNull Object

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

abstract @NonNull Object

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

abstract @NonNull AarMetadata

Options for configuring AAR metadata.

abstract @NonNull List<@NonNull File>

ProGuard rule files to be included in the published AAR.

abstract Boolean

Returns whether multi-dex is enabled.

abstract ApkSigningConfig

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

abstract void
setMultiDexEnabled(Boolean multiDexEnabled)

Returns whether multi-dex is enabled.

abstract void

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

Inherited methods

From com.android.build.api.dsl.VariantDimension
abstract void
addManifestPlaceholders(
    @NonNull Map<@NonNull String, @NonNull Object> manifestPlaceholders
)

Adds manifest placeholders.

abstract void
buildConfigField(
    @NonNull String type,
    @NonNull String name,
    @NonNull String value
)

Adds a new field to the generated BuildConfig class.

abstract void

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

abstract @NonNull ExternalNativeBuildFlags

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

abstract @NonNull JavaCompileOptions

Options for configuring Java compilation.

abstract @NonNull Map<@NonNull String, @NonNull Object>

The manifest placeholders.

abstract File

Text file that specifies additional classes that will be compiled into the main dex file.

abstract File

Text file with additional ProGuard rules to be used to determine which classes are compiled into the main dex file.

abstract @NonNull Ndk

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

abstract @NonNull Optimization
abstract @NonNull List<@NonNull File>

Specifies the ProGuard configuration files that the plugin should use.

abstract @NonNull Shaders

Options for configuring the shader compiler.

abstract @NonNull List<@NonNull File>

The collection of proguard rule files to be used when processing test code.

abstract void

Options for configuring Java compilation.

abstract void
ndk(@ExtensionFunctionType @NonNull Function1<@NonNull NdkUnit> action)

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

abstract void
abstract @NonNull Object
proguardFile(@NonNull Object proguardFile)

Adds a new ProGuard configuration file.

abstract @NonNull Object

Adds new ProGuard configuration files.

abstract void
resValue(@NonNull String type, @NonNull String name, @NonNull String value)

Adds a new generated resource.

abstract Void
setManifestPlaceholders(
    @NonNull Map<@NonNull String, @NonNull Object> manifestPlaceholders
)

This method is deprecated. Use manifestPlaceholders property instead

abstract void
setMultiDexKeepFile(File multiDexKeepFile)

Text file that specifies additional classes that will be compiled into the main dex file.

abstract void
setMultiDexKeepProguard(File multiDexKeepProguard)

Text file with additional ProGuard rules to be used to determine which classes are compiled into the main dex file.

abstract @NonNull Object
setProguardFiles(@NonNull Iterable<@NonNull ?> proguardFileIterable)

Replaces the ProGuard configuration files.

abstract void
shaders(
    @ExtensionFunctionType @NonNull Function1<@NonNull ShadersUnit> action
)

Configure the shader compiler options.

abstract @NonNull Object

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

abstract @NonNull Object

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

Public methods

aarMetadata

abstract void aarMetadata(
    @ExtensionFunctionType @NonNull Function1<@NonNull AarMetadataUnit> action
)

Options for configuring AAR metadata.

consumerProguardFile

abstract @NonNull Object consumerProguardFile(@NonNull Object proguardFile)

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

abstract @NonNull Object consumerProguardFiles(@NonNull Object proguardFiles)

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.

getAarMetadata

abstract @NonNull AarMetadata getAarMetadata()

Options for configuring AAR metadata.

getConsumerProguardFiles

abstract @NonNull List<@NonNull FilegetConsumerProguardFiles()

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.

getMultiDexEnabled

abstract Boolean getMultiDexEnabled()

Returns whether multi-dex is enabled.

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

getSigningConfig

abstract ApkSigningConfig getSigningConfig()

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

setMultiDexEnabled

abstract void setMultiDexEnabled(Boolean multiDexEnabled)

Returns whether multi-dex is enabled.

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

setSigningConfig

abstract void setSigningConfig(ApkSigningConfig signingConfig)

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