I'm trying to adopt the Kotlin Gradle DSL. I have a gradle.properties
with, among other things:
slf4jVersion=2.0.0-alpha1
I declare the dependency in build.gradle.kts
with:
implementation( name = "slf4j-api",
group = "org.slf4j", version = project.properties["slf4jVersion"].toString())
Yes, it works, but it also smells. The issue is the ugliness of project.properties["slf4jVersion"].toString()
Shouldn't I be able to just write slf4jVersion
? It makes standard configuration look like a custom hack. What is the canonical and succinct way to keep version numbers together in a separate file with the Kotlin Gradle DSL?