0.3.2
Pre-releaseGeneral Notes
Gradle Script Kotlin v0.3.2 greatly increases parity with the Groovy based DSL via runtime code generation of Kotlin extension members.
Please note that this is a breaking change as many configuration patterns that previously required a qualifying it
reference no longer do.
Let's take copySpec
as an example. Before v0.3.2 one would write:
copySpec {
it.from("src/data")
it.include("*.properties")
}
With v0.3.2 it should now read:
copySpec {
from("src/data")
include("*.properties")
}
This behavior is only enabled for non-generic Gradle API methods under the org.gradle.api
package at this point. Subsequent releases will increasingly cover the full API.
Gradle Script Kotlin v0.3.2 is expected to be included in the upcoming Gradle 3.1 RC1.
The features in this release are also available for immediate use within the latest Gradle Script Kotlin distribution snapshot. To use it, upgrade your Gradle wrapper in the following fashion:
$ cd $YOUR_PROJECT_ROOT
$ gradle wrapper --gradle-distribution-url https://repo.gradle.org/gradle/kotlin-dsl-snapshots-local/gradle-script-kotlin-3.1-20160908214640+0000-all.zip
Updates since v0.3.1
- Increased parity with the Groovy based DSL via runtime code generation (#117). The qualifying
it
reference is no longer required in many commonly used configuration blocks. - Client module dependencies DSL (#111). It is now possible to configure all aspects of client module dependencies via a type-safe and IDE friendly DSL:
dependencies {
runtime(
module("org.codehaus.groovy:groovy:2.4.7") {
// Configures the module itself
isTransitive = false
dependency("commons-cli:commons-cli:1.0") {
// Configures the external module dependency
isTransitive = false
}
module(group = "org.apache.ant", name = "ant", version = "1.9.6") {
// Configures the inner module dependencies
dependencies(
"org.apache.ant:ant-launcher:1.9.6@jar",
"org.apache.ant:ant-junit:1.9.6")
}
}
)
}
- Content assist is now available to non top-level Kotlin based build scripts (#113). IDE support is now available to Kotlin build scripts even before they are referenced from Groovy build scripts via
apply from: "build.gradle.kts"
statements.