-
Upgrade embedded Kotlin to 1.3.0-RC2 (#1149, #1005, #1112, #1125, #1132)
Note that Gradle Kotlin DSL 1.0 will ship with Kotlin 1.3 GA.
-
Script compilation build cache is now enabled alongside the Gradle Build Cache (#1152)
If you enable the Gradle Build Cache then the Gradle Kotlin DSL will store and fetch the outputs of script compilation, avoiding the expensive work of recompiling them.
-
Accessors for plugins present in buildSrc (#1156)
You can now refer statically to plugins declared in buildSrc. Instead of:
plugins {
id("my.buildSrc.plugin.ID")
}
you can now write:
plugins {
my.buildSrc.plugin.ID
}
-
Accessors for elements of collections (#879, #1041)
It is now possible to refer to elements of collections available at build script body compilation time via type-safe accessors. This is applied to configurations, tasks and all Gradle extensions that are collections such as sourceSets. For tasks, it means that instead of writing:
plugins {
java
}
tasks {
named<Test>("test") {
testLogging.showStacktraces = true
}
}
you can now write:
plugins {
java
}
tasks {
test {
testLogging.showStacktraces = true
}
}
-
Accessors for artifact configurations in configurations {} (#1118, #1129)
Accessors for artifact configurations were missing in the configurations {} block. This has been fixed the same way as for all collections, see above. Instead of:
plugins {
java
}
configurations {
named("implementation") {
exclude(group = "org.foo")
}
}
you can now write:
plugins {
java
}
configurations {
implementation {
exclude(group = "org.foo")
}
}
-
Refine dependency constraints DSL (#710, #1091)
Accessors for artifact configurations were missing in the dependencies { constraints {} } block. This has been fixed. Instead of:
plugins {
java
}
dependencies {
constraints {
add("implementation", "com.google.collections:google-collections") {
version { rejectAll() }
because("Google collections is superceded by Guava")
}
}
}
you can now write:
plugins {
java
}
dependencies {
constraints {
implementation("com.google.collections:google-collections") {
version { rejectAll() }
because("Google collections is superceded by Guava")
}
}
}
-
Refine containers API (#1042, #1104, #1108, #1116)
During the RC phase, several discrepancies were found in the domain object collections and containers API. Special care has been taken to iron it in this release. Please see the linked issues for more information.
-
Let the kotlin-dsl plugin configure precompiled script plugins support (#1135)
Applying the kotlin-dsl plugin now also applies the kotlin-dsl-precompiled-script-plugins plugin. See the Gradle Kotlin DSL Primer chapter of the Gradle User Manual for more information.
-
Refine IDE script dependencies resolver (#1133, #1124, #1139)
The dependencies resolver backing IDE editors for .gradle.kts scripts has been refined to emit warnings only when necessary and display actionable messages. Please see the linked issues for more information.