Kotlin-dsl-samples: Kotlin DSL 0.17.4 in Gradle 4.8-rc-1 breaks tasks.getting() and tasks.creating() with older versions of Gradle

Created on 23 May 2018  路  3Comments  路  Source: gradle/kotlin-dsl-samples

Kotlin DSL added support for syntax like:

val configureDar by tasks.getting(DarConfigurationTask::class)

The getting and creating extension functions used by older versions of Gradle (4.5.1, 4.6, 4.7) subprojects/provider/src/main/kotlin/org/gradle/kotlin/dsl/NamedDomainObjectContainerExtensions.kt was removed in commit 77224e2e1b7a9d00b29d08cc4230f3fd2d964621. So there is now an undocumented binary incompatibility with plugins compiled with Gradle 4.8_rc_1 and previous versions.

Expected Behavior

Either the extension functions used by older versions of Gradle should remain (possibly deprecated) or the backwards incompatibility of plugins written in Kotlin DSL should be listed in the breaking changes section of the release notes.

Current Behavior

A plugin written in Koltin DSL using tasks.getting() or tasks.creating() will work if compiled with Gradle 4.8-rc-1 and run on that version, or if compiled with an earlier version and run with that earlier version. However compiling with Gradle 4.8-rc-1 and running with an earlier version does not work.

Context

We would prefer that the Kotlin DSL does not have a binary compatibility issue between versions.

Steps to Reproduce (for bugs)

Apply any plugin that uses tasks.getting() or tasks.setting() compiled with Gradle 4.8-rc-1 and use with Gradle 4.7. I will try to add a simple example that can be used to validate on GitHub. later

Your Environment

Windows & Linux using Gradle 4.8-rc-1 and Gradle 4.7/4.6/4.5.1.

question

All 3 comments

The Gradle Kotlin DSL has very few version compatibility guarantees until 1.0.
Plugin authors should be wary of the Kotlin DSL api not having binary incompatible changes.

That is understood which is why I'm testing Kotlin DSL plugins with every release. Just asking that if it was a planned incompatibility that it be mentioned in the release notes as a breaking change, and making you aware if if not.

@sic-bre, thanks for the report!
This is an oversight, I updated the release notes: https://github.com/gradle/kotlin-dsl/releases/tag/v0.17.4

Was this page helpful?
0 / 5 - 0 ratings