Closed magJ closed 5 years ago
Not sure that I really agree with that assessment, even if a collection overload is eventually added to the gradle API, the kotlin-dsl will still need to provide specialized configuration accessors pointing to it.
Can you elaborate?
Can you elaborate?
Well for example the kotlin-dsl adds functions like
fun DependencyHandler.create(
group: String,
name: String,
version: String? = null,
configuration: String? = null,
classifier: String? = null,
ext: String? = null
)
I would argue, that following the same logic, this function should be part of the gradle API itself.
If a Collection
method was later added to the gradle API, the accessors implementation could just be switched to point to the new API(assuming the added API also has a void/Unit return type.)
Context
The gradle-dsl supports adding multiple dependencies at a time, using collections and varargs syntax. Thus when transitioning scripts from groovy to kotlin users are forced to adopt a much more verbose syntax.
https://github.com/gradle/kotlin-dsl/issues/639 https://github.com/gradle/kotlin-dsl/issues/1187 https://github.com/gradle/gradle/issues/7649
In #639 the determination was made that this functionality should be added upstream by adding to gradles
DependencyHandler
API, and thus the issue was migrated.Not sure that I really agree with that assessment, even if a collection overload is eventually added to the gradle API, the kotlin-dsl will still need to provide specialized configuration accessors pointing to it.
Contributor Checklist
develop
branch./gradlew check --parallel