https://kotlinlang.org logo
Title
i

igor.wojda

10/03/2018, 10:41 AM
Is it possible to extract gradle plugin dependencies with their versions into separate variables? Now
//custom objects in gradle buildSrc (to have dependency autocompletion)
object GradlePluginVersion {
    const val detekt = "1.0.0.RC7"
}

object GradlePluginId {
    const val detekt = "io.gitlab.arturbosch.detekt"
}
//build.gradle
plugins {
    id(GradlePluginId.detekt) version GradlePluginVersion.detekt
}
Want
//build.gradle
plugins {
    GradlePluginDependency.detekt
}
The issue I have is that
plugin
DSL expect
PluginDependenciesSpec
with is an interface, not a concrete class 🤔
s

spand

10/03/2018, 10:44 AM
If you can live with
//build.gradle
plugins {
    GradlePluginDependency.detekt()
}
Then you can extract it to a
PluginDependenciesSpec.() -> Unit
Or I expect it to be possible. Not using gradlekt, just a lurker.
i

igor.wojda

10/05/2018, 5:33 PM
Thanks @spand