Luc-Antoine Girardin
05/14/2024, 4:17 PMdependencies {
implementation("io.gitlab.arturbosch.detekt:detekt-gradle-plugin:[version]")
}
• One in my convention plugin in buildSrc/src/main/kotlin/detekt-conventions.gradle.kts
dependencies {
detektPlugins("io.gitlab.arturbosch.detekt:detekt-formatting:[version]")
}
Is there a way to define a constant somewhere that I can reuse to simplify updates? (Note that my version of Gradle doesn't support version catalogs) Or a way to get the version from the other place?ephemient
05/14/2024, 5:14 PMDetekt::class.java.getResourceAsStream("/detekt-versions.properties").use { Properties().apply { load(it) } }.getProperty("detektVersion")
since Detekt happens to ship a resource inside their JAR that contains its own version info. I'm not sure it's worth depending on their internals to save you from having two constants to update though.