Eric
02/18/2022, 3:27 PMdetekt-config-1.15.yml
and detekt-config-1.19.yml
etc. I’d like my task to just discover the version of detekt and built the URL automatically. I can do something like
project.extensions.findByName("io.gitlab.arturbosch.detekt")
to find the plugin, but then how can I introspect that to find the version?Eric
02/18/2022, 3:32 PMval detektPlugin = project.extensions.findByName("detekt") as CodeQualityExtension
val version = detektPlugin.toolVersion
Eric
02/18/2022, 7:00 PMnull
😞Eric
02/18/2022, 8:14 PMval version = project.configurations.getByName(CONFIGURATION_DETEKT).dependencies.first { it.group == "io.gitlab.arturbosch.detekt" }.version!!
and
val version = Properties().run {
DetektPlugin::class.java.classLoader.getResourceAsStream("versions.properties").bufferedReader()
.let { load(it) }
getProperty("detektVersion")
}