Quite sad about provider delegates <https://docs.g...
# community-news
b
Quite sad about provider delegates https://docs.gradle.org/current/userguide/upgrading_version_9.html#kotlin_dsl_delegated_properties I think they improved significantly the build legibility.
Copy code
w: file:///.../buildSrc/build.gradle.kts:110:17: 'fun <T : Any, U : T> NamedDomainObjectContainer<T>.getting(type: KClass<U>, configuration: U.() -> Unit): PolymorphicDomainObjectContainerGettingDelegateProvider<T, U>' is deprecated. Use 'val element = getByName<Type>(name) { }' instead. See the Gradle 9.6 upgrading guide.
💯 3
🍿 1
☝️ 3
👎 1
😬 1
Also, frankly that's one of thing I had the less issue with, once you know what they are (which is not the hardest concept). FYI, this is not really announced in the release note of the 9.6.0, but you can find it listed here https://github.com/gradle/gradle/issues/37555. Otherwise you have to go to the upgrade guide.
An there are more discussions that were going on here : https://github.com/gradle/gradle/pull/37556
It's very disappointing, the blast radius is significant. As if we didn't have enough to do with our builds. I can understand many of the deprecation and bugs, but this one is a hard buy.
1
a
I raised objections https://github.com/gradle/gradle/issues/37604, but it was dismissed. I don't think my points were understood. The only real issue with delegate creation of tasks is
by tasks.creating
without a value is a no-op, but this can be fixed in the near future with https://kotlinlang.org/docs/unused-return-value-checker.html.
👍 1
t
seeing the large list of deprecations made me glad I always removed those constructs whenever I saw them and replaced them with standard APIs
b
Well I did that too ! As I didn't want the warnings, but clearly it's not a cold shower, but I'm really not happy by this. As @Adam said, the main issue is addressable. But to be fair, the property delegates felt like standard api (for kotlin DSL).
t
I mean I did it from the beginning. I never liked them 🙃 I agree they did feel like a standard api, given they were recommended in the docs. But I disagree that they were ever a good idea. The actual-standard APIs (that work in any context, not just Kotlin DSL) have always been sufficient and easier to understand and maintain
r
For anyone else who's curious, this is the design doc for this change https://docs.google.com/document/d/140dOuBcCEDCKLGTiY80NNx2bCQ7dUv8EVFsn4ph86fU/edit?usp=sharing
👍 2
I distinctly recall being nudged (by IntelliJ?) to use the property delegate syntax wherever possible
t
we all make mistakes ¯\_(ツ)_/¯
b
Well it's a solid kotlin feature in my opinion.
1