ApplicationVariantBuilder

public interface ApplicationVariantBuilder extends VariantBuilder, HasAndroidTestBuilder, HasUnitTestBuilder, HasTestFixturesBuilder, GeneratesApkBuilder, CanMinifyCodeBuilder, CanMinifyAndroidResourcesBuilder


Application specific variant object that contains properties that will determine the variant's build flow.

For example, an application variant may have minification on or off, or have a different minSdkVersion from the other variants.

All these properties must be resolved during configuration time as org.gradle.api.Task representing the variant build flows must be created.

Summary

Public methods

abstract boolean
abstract @NonNull DependenciesInfoBuilder

Specify whether to include SDK dependency information in APKs and Bundles.

Inherited methods

From com.android.build.api.variant.CanMinifyAndroidResourcesBuilder
abstract boolean

Specifies whether resources will be shrinked

abstract void
setShrinkResources(boolean shrinkResources)

Specifies whether resources will be shrinked

From com.android.build.api.variant.CanMinifyCodeBuilder
abstract boolean

Specifies whether code will be minified

abstract void
setMinifyEnabled(boolean isMinifyEnabled)

Specifies whether code will be minified

From com.android.build.api.variant.ComponentBuilder
abstract boolean

Set to true if the variant is active and should be configured, false otherwise.

abstract boolean
abstract void
setEnable(boolean enable)

Set to true if the variant is active and should be configured, false otherwise.

abstract void
setEnabled(boolean enabled)
From com.android.build.api.variant.ComponentIdentity
abstract String

Build type name, might be replaced with access to locked DSL object once ready.

abstract String

The multi-flavor name of the variant.

abstract @NonNull String

Component's name.

abstract @NonNull List<@NonNull Pair<@NonNull String, @NonNull String>>

List of flavor names, might be replaced with access to locked DSL objects once ready.

From com.android.build.api.variant.HasAndroidTestBuilder
abstract boolean

Set to true if the variant's has any android tests, false otherwise.

abstract boolean

Set to true if the variant's has any android tests, false otherwise.

abstract void
setAndroidTestEnabled(boolean androidTestEnabled)

Set to true if the variant's has any android tests, false otherwise.

abstract void
setEnableAndroidTest(boolean enableAndroidTest)

Set to true if the variant's has any android tests, false otherwise.

From com.android.build.api.variant.HasTestFixturesBuilder
abstract boolean

Set to true if the variant's has test fixtures, false otherwise.

abstract void
setEnableTestFixtures(boolean enableTestFixtures)

Set to true if the variant's has test fixtures, false otherwise.

From com.android.build.api.variant.VariantBuilder
abstract boolean

Set to true if the variant's has any unit tests, false otherwise.

abstract Integer

Gets the maximum supported SDK Version for this variant.

abstract Integer

Gets or sets the minimum supported SDK Version for this variant.

abstract String

Gets or sets the minimum supported SDK Version for this variant as a Preview codename.

abstract int

Specifies the bytecode version to be generated.

abstract Integer

Gets or sets the target SDK Version for this variant as a Preview codename.

abstract String

Gets or sets the target SDK Version for this variant as a Preview codename.

abstract boolean

Set to true if the variant's has any unit tests, false otherwise.

abstract void
<T extends Object> registerExtension(
    @NonNull Class<@NonNull T> type,
    @NonNull T instance
)

Registers an extension object to the variant object.

abstract void
setEnableUnitTest(boolean enableUnitTest)

Set to true if the variant's has any unit tests, false otherwise.

abstract void

Gets the maximum supported SDK Version for this variant.

abstract void

Gets or sets the minimum supported SDK Version for this variant.

abstract void
setMinSdkPreview(String minSdkPreview)

Gets or sets the minimum supported SDK Version for this variant as a Preview codename.

abstract void
setRenderscriptTargetApi(int renderscriptTargetApi)

Specifies the bytecode version to be generated.

abstract void
setTargetSdk(Integer targetSdk)

Gets or sets the target SDK Version for this variant as a Preview codename.

abstract void
setTargetSdkPreview(String targetSdkPreview)

Gets or sets the target SDK Version for this variant as a Preview codename.

abstract void
setUnitTestEnabled(boolean unitTestEnabled)

Set to true if the variant's has any unit tests, false otherwise.

Public methods

getDebuggable

abstract boolean getDebuggable()

getDependenciesInfo

abstract @NonNull DependenciesInfoBuilder getDependenciesInfo()

Specify whether to include SDK dependency information in APKs and Bundles.