v1.1.1
版本发布时间: 2019-01-11 07:56:02
gradle/kotlin-dsl-samples最新发布版本:v1.1.3(2019-01-29 18:57:52)
Gradle Kotlin DSL 1.1.1 Release Notes
Gradle Kotlin DSL 1.1.1 fixes issues around type-safe accessors generation correctness and introduces a missing reified generic Kotlin extension to create MapProperty
objects.
v1.1.1 is included in Gradle 5.1.1.
To use it, upgrade your Gradle wrapper in the following fashion:
$ cd $YOUR_PROJECT_ROOT
$ gradle wrapper --gradle-version 5.1.1 --distribution-type all
Updates since v1.1.0 (Gradle 5.1)
-
Add convenience method for
MapProperty
introduced in 5.1 (#1307)The new method makes working with map inputs a little more convenient:
open class Generator : DefaultTask() { @Input val properties = project.objects.mapProperty<String, Int>() @TaskAction fun generate() { properties.get().forEach { (key, value) -> logger.quiet("$key = $value") } } }
-
Caching of type-safe model accessors didn't take differences in container elements into account (#1303, #1304)
In order to speed up the compilation of Kotlin DSL build scripts and amortise the cost of the required code generation step, the Kotlin DSL script compiler tries to maximise the reuse of generated type-safe model accessors across projects and builds.
It does that by caching the generated code based on a key defined by, among other things, the set of accessible Gradle model elements in the target project.
In previous versions however, the cache key definition was missing elements from Gradle model containers such as
tasks
andsourceSets
which would cause accessors generated for one project to be (wrongly) reused for another project when they differed only in the set of accessible container elements.This defect has been fixed.
For the complete list see the gradle/kotlin-dsl
issues for 1.1.1.