Android Plugin DSL Reference

Version 2.2

Introduction

This is the DSL reference for Android Gradle Plugin.

Start reading by finding the right extension type for the plugin you are using, e.g. AppExtension.

Extension types

Listed below are the Gradle extension types used by respective plugins:

TypeDescription
AppExtension

android extension for com.android.application projects.

LibraryExtension

android extension for com.android.library projects.

TestExtension

android extension for com.android.test projects.

Configuration blocks

Listed below are the configuration blocks available within android

BlockDescription
aaptOptions { }

Configures aapt options.

adbOptions { }

Configures adb options.

buildTypes { }

Configures build types.

compileOptions { }

Configures compile options.

dataBinding { }

Configures data binding options.

defaultConfig { }

The default configuration, inherited by all product flavors (if any are defined).

dexOptions { }

Configures dex options.

externalNativeBuild { }

Configures external native build options.

jacoco { }

Configures JaCoCo options.

lintOptions { }

Configures lint options.

packagingOptions { }

Configures packaging options.

productFlavors { }

Configures product flavors.

signingConfigs { }

Configures signing configs.

sourceSets { }

Configures source sets.

splits { }

Configures APK splits.

testOptions { }

Configures test options.