Hi, I maintain a library called <sarif4k>. This li...
# community-support
b
Hi, I maintain a library called sarif4k. This library is used by the detekt-gradle-plugin that supports gradle
8.14.3
. Detekt can't update to the last version of sarif4k because it uses a recent version of kotlin (https://github.com/gradle/gradle/issues/16345). The problem is not the library itself but its dependencies. My question, is there any tool I can run on sarif4k side to ensure that my library is compatible with certain version of gradle (or kotlin, I don't care, I can make the conversion). I want to run it on CI so this doesn't happen again.
The error detekt gets when integrating with the current version of sarif4k is:
Class 'kotlin.Unit' was compiled with an incompatible version of Kotlin. The actual metadata version is 2.3.0, but the compiler version 2.1.0 [with language version 1.8.0] can read versions up to 2.2.0
So I guess that I should assert that all the code in my library (and dependencies) has metadata up to 2.2.0.
For full context https://github.com/detekt/detekt/pull/9247 this is the PR integrating sarif4k in detekt. Also, @jcopenhop created this PR: https://github.com/detekt/sarif4k/pull/272 to fix the issue. But what I want is something to ensure that we don't add any regression in the future.
I found the answer: https://gradleup.com/tapmoc/
y
This is probably one of the best solutions to test for compatibility on the long run: ysb33rorg.gitlab.io/gradle/gradleTest
❤️ 1
j
yes, you should target the kotlin version of the minimum gradle version you support: https://docs.gradle.org/current/userguide/compatibility.html#kotlin you can use a newer KGP, as long as you set the languagelevel and api level to the right version. (tapmoc does this for you). for testing, Gradle testkit has the ability built-in in the GradleRunner API to test against multiple gradle versions. nebula-test has some helpers to make this a little easier: https://github.com/nebula-plugins/nebula-test/wiki/TestKit-DSL#testing-against-multiple-versions-of-gradle but you can use it directly in testkit
❤️ 1