Details about advanced configuration options
There are three plugins which the Eta Gradle plugin provides:
This plugin is used for configuring your Eta and Etlas versions and other global parametrs for all the projects in your build. It will activate the eta extension block that will allow you to do so.
NOTE: Both the Eta Plugin and the Eta Android Plugin apply the Eta Base Plugin by default, so if you apply either one, it is not required to apply this one!
This plugin is used for JVM projects and depends on the Java Plugin. It overrides the Java Plugin's lifecycle so that it can provide a smooth integration.
This plugin is used for Android projects. It overrides the Android lifecycle to provide a smooth integration into the build.
The recommended way to apply the plugins mentioned above is the Plugins DSL. Note that using this DSL will automatically download the plugin and apply it to the current project, so you don't need to add an apply plugin: statement afterward.
1 2 3 | plugins {
id 'com.typelead.eta.base' version '0.7.2'
}
|
1 2 3 | plugins {
id 'com.typelead.eta' version '0.7.2'
}
|
1 2 3 | plugins {
id 'com.typelead.eta.android' version '0.7.2'
}
|
The old method of applying plugins can be done by specifying a buildscript block which points to the Gradle Plugins Portal.
1 2 3 4 5 6 7 8 9 10 | buildscript {
repositories {
maven {
url 'https://plugins.gradle.org/m2/'
}
}
dependencies {
classpath 'gradle.plugin.com.typelead:gradle-eta:0.7.2'
}
}
|
Now that you have told Gradle where to find the plugin binary, the next step is to specify which plugin you want to apply to your build.
1 | apply plugin: 'eta-base'
|
1 | apply plugin: 'eta'
|
1 | apply plugin: 'eta-android'
|
If you're hacking on the plugin or want to try the unreleased version due to critical bug fixes or cool features, you have to build and install the plugin from source.
$ git clone https://github.com/typelead/gradle-eta
$ cd gradle-eta
$ ./gradlew pTML
$ gradle.bat pTML
Then, add a buildscript block in the build.gradle for the project in which you want to use the plugin you just built.
1 2 3 4 5 6 7 8 9 | buildscript {
repositories {
mavenLocal()
dependencies {
classpath 'com.typelead:gradle-eta:latest.release'
}
}
}
|
Finally, applying the plugins follows the same process as Applying with Legacy Method, excluding the buildscript block.