Curious what's the reasoning behind not having ```...
# gradle
e
Curious what's the reasoning behind not having
Copy code
fun DependencyHandlerScope.implementations(vararg deps: Any) =
    deps.forEach { this.implementation(it) }

fun DependencyHandlerScope.testImplementations(vararg deps: Any) =
    deps.forEach { this.testImplementation(it) }
in Gradle Kotlin DSL
🆒 1
🤩 1
To be able to do like this
Copy code
dependencies {
    implementations(
        libs.spring.boot.starter.web,
        libs.kotlinx.serialization.json,
        libs.commercetools.http.client,
        libs.commercetools.sdk.api,
        libs.commercetools.sdk.importapi,
        <http://libs.commercetools.sdk.ml|libs.commercetools.sdk.ml>,
    )

    testImplementations(
        libs.slf4j.api,
        libs.logback.classic,
        libs.mockk,
        libs.kotest.runner,
        libs.kotest.assertions,
        libs.kotest.property,
        libs.kotlinx.coroutines.test,
        libs.spring.boot.starter.test,
    )
}
I really like that syntax without repetition. But maybe there are some caveats and reasons why Gradle Kotlin DSL doesn’t ship with this kind of shorthand (
implementations(...)
,
testImplementations(...)
) out of the box like Groovy DSL allows out of the box. But now I do not see any
v
t
2018 😬
a
Thanks it is a cool idea. And since we're working on adding kotlin-level dependencies block via gradle's dependency collector mechanism here is the YT ticket to track and share feedback: https://youtrack.jetbrains.com/issue/KT-80296/Improve-dependency-declaration-DSL-by-prov[…]thod-call-for-adding-multiple-dependencies-for-each-scope
gratitude thank you 1
v
But shouldn't this still be added on Gradle-side, not Kotlin-side? If it is added at all.
e
Copy code
dependencies {
    listOf(
        libs.spring.boot.starter.web,
        libs.kotlinx.serialization.json,
        libs.commercetools.http.client,
        libs.commercetools.sdk.api,
        libs.commercetools.sdk.importapi,
        <http://libs.commercetools.sdk.ml|libs.commercetools.sdk.ml>,
    ).forEach(::implementation)

    listOf(
        libs.slf4j.api,
        libs.logback.classic,
        libs.mockk,
        libs.kotest.runner,
        libs.kotest.assertions,
        libs.kotest.property,
        libs.kotlinx.coroutines.test,
        libs.spring.boot.starter.test,
    ).forEach(::testImplementation)
}
is possible now
👍 3
😲 1