Is it possible to define ktlint version using valu...
# ktlint
m
Is it possible to define ktlint version using value from version catalog?
Copy code
apply plugin: libs.plugins.ktlint.get().getPluginId()

ktlint {
    debug = true
    android = true
    version.set(libs.plugins.ktlint.get().getVersion().toString())
    reporters {
        reporter "html"
        reporter "plain"
    }
}
If I run
./gradlew ktlintFormat
, task execution fails with
Execution failed for task ':app:loadKtlintReporters'.
> Could not resolve all files for configuration ':app:ktlint'.
> Could not find com.pinterest:ktlint:11.5.1.
...
If I hardcode value
version.set("0.50.0")
(or any other version) it works fine.
m
The catalog uses 11.5.1, which doesn't exist
m
I see now... I accidentally replaced
ktlint
version with
ktlint gradle plugin
version. Thanks for noticing that.
w
ktlint version and ktlint-gradle plugin version are 2 separate things