


For reuse within a project, scripts can be written in Groovy or Kotlin and applied in multiple build files, but often a better place for custom imperative logic is buildSrc, which can use Java, Groovy and Kotlin, and for reuse by separate projects or the build can be customized by binary plugins written in Java, Groovy or Kotlin.

The DSL is not the only way to extend the build. Android Gradle Plugin 4.1 now fully supports the new Kotlin DSL.

The Android Gradle Plugin DSL was written before the Gradle Kotlin DSL was introduced, and needed a refresh to work well with the Gradle Kotlin DSL. Gradle and the Android Gradle Plugin provide the ability to configure and extend the build in different ways depending on the use case.įor simple projects where the configuration is mostly declarative, the Android Gradle Plugin can be configured in adle files which are written with Gradle Build Language, or Domain Specific Language (DSL) which is built on top of Groovy script, or files that are written using Gradle Kotlin DSL, which was introduced more recently. The Android Gradle Plugin is decoupled from Android Studio - Android Studio can open projects that use the corresponding Android Gradle Plugin or any previous stable version, currently down all the way to Android Gradle Plugin 1.1. The Android Gradle Plugin is the supported build system for Android applications and includes support for compiling many different types of sources and linking them together into an application that you can run on a physical Android device or an emulator.
