gradle / gradle

Adaptable, fast automation for all
https://gradle.org
Apache License 2.0
16.96k stars 4.76k forks source link

Deprecate resolution of a Configuration without attributes #13736

Open jjohannes opened 4 years ago

jjohannes commented 4 years ago

Something like this should yield a deprecation warning:

val legacy by configurations.creating  // resolvable configuration without attributes (!)

tasks.register("legacyResolve") {
    doLast { legacy.files.forEach { println(it.name) } }
}

There are many builds/plugins out there doing this. Many from the time where attributes did not even exist. We should inform that this is problematic. While it still works in many cases, thanks to disambiguation rules, the more attributes are used, the more problematic it may become in particular if libraries from different ecosystems (Java, Kotlin, Kotlin Multiplatform, Android, ...) are combined.

~With #13650 we now also offer an API to create resolvable configurations with initial attributes set.~

big-guy commented 4 months ago

We should do this early in 9.x