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

LibraryBaseFlavor

interface LibraryBaseFlavor : BaseFlavor, LibraryVariantDimension

Known direct 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.


Summary

Public functions

@Incubating Unit
setTargetSdkVersion(targetSdkVersion: String?)

This function is deprecated. Replaced by targetSdkPreview property

@Incubating Unit
targetSdkVersion(targetSdkVersion: Int)

This function is deprecated. Replaced by targetSdk property

@Incubating Unit
targetSdkVersion(targetSdkVersion: String?)

This function is deprecated. Replaced by targetSdkPreview property

Public properties

Int?

This property is deprecated. Will be removed from library DSL in v9.0

String?

This property is deprecated. Will be removed from library DSL in v9.0

Inherited functions

From class com.android.build.api.dsl.BaseFlavor
@Incubating String

The name of the flavor.

@Incubating Unit

Copies all properties from the given flavor.

@Incubating Unit
minSdkVersion(minSdkVersion: Int)

This function is deprecated. Replaced by minSdk property

@Incubating Unit
minSdkVersion(minSdkVersion: String?)

This function is deprecated. Replaced by minSdkPreview property

@Incubating Unit
missingDimensionStrategy(dimension: String, requestedValue: String)

Specifies a flavor that the plugin should try to use from a given dimension in a dependency.

@Incubating Unit
missingDimensionStrategy(
    dimension: String,
    requestedValues: List<String>
)

Specifies a sorted list of flavors that the plugin should try to use from a given dimension in a dependency.

@Incubating Unit
missingDimensionStrategy(
    dimension: String,
    vararg requestedValues: String
)

Specifies a sorted list of flavors that the plugin should try to use from a given dimension in a dependency.

@Incubating Unit
resConfig(config: String)

This function is deprecated. Replaced by resourceConfigurations field

@Incubating Unit

This function is deprecated. Replaced by resourceConfigurations field

@Incubating Unit
resConfigs(vararg config: String)

This function is deprecated. Replaced by resourceConfigurations field

@Incubating Unit
setMinSdkVersion(minSdkVersion: Int)

This function is deprecated. Replaced by minSdk property

@Incubating Unit
setMinSdkVersion(minSdkVersion: String?)

This function is deprecated. Replaced by minSdkPreview property

@Incubating Any?
setTestFunctionalTest(testFunctionalTest: Boolean)

This function is deprecated. Replaced by testFunctionalTest property

@Incubating Any?
setTestHandleProfiling(testHandleProfiling: Boolean)

This function is deprecated. Replaced by testFunctionalTest property

@Incubating Any?
setTestInstrumentationRunnerArguments(
    testInstrumentationRunnerArguments: MutableMap<StringString>
)

This function is deprecated. Replaced by testInstrumentationRunnerArguments property

@Incubating Unit

This function is deprecated. Replaced by testInstrumentationRunnerArguments property

@Incubating Unit

This function is deprecated. Replaced by testInstrumentationRunnerArguments property

@Incubating Unit

Configures VectorDrawables.

From class com.android.build.api.dsl.LibraryVariantDimension
@Incubating Unit

Options for configuring AAR metadata.

@Incubating 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 com.android.build.api.dsl.VariantDimension
@Incubating Unit
addManifestPlaceholders(manifestPlaceholders: Map<StringAny>)

Adds manifest placeholders.

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

Adds a new ProGuard configuration file.

@Incubating Any
proguardFiles(vararg files: Any)

Adds new ProGuard configuration files.

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

Adds a new generated resource.

@Incubating Void?
setManifestPlaceholders(manifestPlaceholders: Map<StringAny>)

This function is deprecated. Use manifestPlaceholders property instead

@Incubating Any
setProguardFiles(proguardFileIterable: Iterable<*>)

Replaces the ProGuard configuration files.

@Incubating Unit

Configure the shader compiler options.

@Incubating Any
testProguardFile(proguardFile: Any)

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

@Incubating 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.BaseFlavor
Int?

The minimum SDK version.

String?

The minimum SDK version.

Boolean?

Whether the renderscript code should be compiled to generate C/C++ bindings.

Boolean?

Whether the renderscript BLAS support lib should be used to make it compatible with older versions of Android.

Boolean?

Whether the renderscript code should be compiled in support mode to make it compatible with older versions of Android.

Int?

The renderscript target api, or null if not specified.

MutableSet<String>

Specifies a list of alternative resources to keep.

String?

Test application ID.

Boolean?

See instrumentation.

Boolean?

See instrumentation.

String?

Test instrumentation runner class name.

MutableMap<StringString>

Test instrumentation runner custom arguments.

VectorDrawables

Options to configure the build-time support for vector drawables.

Boolean?

Whether to enable unbundling mode for embedded wear app.

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 functions

setTargetSdkVersion

@Incubating
fun setTargetSdkVersion(targetSdkVersion: String?): Unit

targetSdkVersion

@Incubating
fun targetSdkVersion(targetSdkVersion: Int): Unit

targetSdkVersion

@Incubating
fun targetSdkVersion(targetSdkVersion: String?): Unit

Public properties

targetSdk

var targetSdkInt?

The target SDK version used for building the test APK.

This is propagated in the library manifest, but that is only advisory for libraries that depend on this library.

Setting this it will override previous calls of targetSdk and targetSdkPreview setters. Only one of targetSdk and targetSdkPreview should be set.

See uses-sdk element documentation.

targetSdkPreview

var targetSdkPreviewString?

The target SDK version used for building the test APK.

This is propagated in the library manifest, but that is only advisory for libraries that depend on this library.

Setting this it will override previous calls of targetSdk and targetSdkPreview setters. Only one of targetSdk and targetSdkPreview should be set.

See uses-sdk element documentation.