AppExtension

'android' extension for 'com.android.application' project.

Properties

PropertyDescription
aaptOptions

Options for aapt, tool for packaging resources.

applicationVariants

The list of Application variants. Since the collections is built after evaluation, it should be used with Gradle's all iterator to process future items.

buildToolsVersion

Required. Version of the build tools to use.

buildTypes

Build types used by this project.

compileOptions

Compile options

compileSdkVersion

Required. Compile SDK version.

defaultConfig

Default config, shared by all flavors.

defaultPublishConfig

Name of the configuration used to build the default artifact of this project.

dexOptions

Dex options.

jacoco

JaCoCo options.

lintOptions

Lint options.

packagingOptions

Packaging options.

productFlavors

All product flavors used by this project.

publishNonDefault

Whether to publish artifacts for all configurations, not just the default one.

resourcePrefix

A prefix to be used when creating new resources. Used by Studio

signingConfigs

Signing configs used by this project.

sourceSets

All source sets. Note that the Android plugin uses its own implementation of source sets, AndroidSourceSet.

splits

APK splits options.

testOptions

Options for running tests.

testVariants

The list of (Android) test variants. Since the collections is built after evaluation, it should be used with Gradle's all iterator to process future items.

variantFilter

A variant filter to control which variants are excluded.

Methods

MethodDescription
adbOptions(action)

Configures adb options.

useLibrary(name)

Request the use a of Library. The library is then added to the classpath.

useLibrary(name, required)

Request the use a of Library. The library is then added to the classpath.

Script blocks

No script blocks

Property details

AaptOptions aaptOptions

Options for aapt, tool for packaging resources.

DefaultDomainObjectSet<ApplicationVariant> applicationVariants

The list of Application variants. Since the collections is built after evaluation, it should be used with Gradle's all iterator to process future items.

String buildToolsVersion

Required. Version of the build tools to use.

Value assigned to this property is parsed and stored in a normalized form, so reading it back may give a slightly different string.

Build types used by this project.

CompileOptions compileOptions

Compile options

String compileSdkVersion

Required. Compile SDK version.

Your code will be compiled against the android.jar from this API level. You should generally use the most up-to-date SDK version here. Use the Lint tool to make sure you don't use APIs not available in earlier platform version without checking.

Setter can be called with a string like "android-21" or a number.

Value assigned to this property is parsed and stored in a normalized form, so reading it back may give a slightly different string.

ProductFlavor defaultConfig

Default config, shared by all flavors.

String defaultPublishConfig

Name of the configuration used to build the default artifact of this project.

See Referencing a Library

DexOptions dexOptions

Dex options.

JaCoCo options.

LintOptions lintOptions

Lint options.

PackagingOptions packagingOptions

Packaging options.

NamedDomainObjectContainer<CoreProductFlavor> productFlavors

All product flavors used by this project.

boolean publishNonDefault

Whether to publish artifacts for all configurations, not just the default one.

See Referencing a Library

String resourcePrefix

A prefix to be used when creating new resources. Used by Studio

Signing configs used by this project.

All source sets. Note that the Android plugin uses its own implementation of source sets, AndroidSourceSet.

Splits splits

APK splits options.

See APK Splits.

TestOptions testOptions

Options for running tests.

DomainObjectSet<TestVariant> testVariants

The list of (Android) test variants. Since the collections is built after evaluation, it should be used with Gradle's all iterator to process future items.

Closure<Void> variantFilter

A variant filter to control which variants are excluded.

The filter is a closure which is passed a single object of type VariantFilter. It should set the VariantFilter.setIgnore() flag to filter out the given variant.

Method details

void adbOptions(Action<AdbOptions> action)

Configures adb options.

void useLibrary(String name)

Request the use a of Library. The library is then added to the classpath.

void useLibrary(String name, boolean required)

Request the use a of Library. The library is then added to the classpath.