This plugin adds support for writing Android applications using the Groovy language.
Edit your build.gradle
file with the following:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:0.12.2'
classpath 'me.champeau.gradle:gradle-groovy-android-plugin:0.3.0'
}
}
apply plugin: 'me.champeau.gradle.groovy-android'
Then you must choose which version and modules of Groovy you use. So far, Android support is available in
the 2.4.0-beta-1 release and beyond, so you need to add the following repository to your build.gradle
file:
repository {
jcenter() // or mavenCentral()
}
Then you can start using Groovy by adding a dependency on the grooid
classifier:
dependencies {
compile 'org.codehaus.groovy:groovy:2.4.0-beta-3:grooid'
}
then use the assembleDebug
task to test.
This plugin has been successfully tested with Android Studio. It will let you write an application in Groovy. It is
recommended, for performance, memory and battery life, that you use @CompileStatic
wherever possible.
Details can be found on my blog and here for more technical details