ci(agp-matrix): Generate compatibility matrix dynamically#873
Conversation
runningcode
left a comment
There was a problem hiding this comment.
looks good! i hope those pages remain stable!
| private fun fetchKotlinGradleCompatibility(): Map<VersionRange, VersionRange> { | ||
| return try { | ||
| // Parse the official Kotlin documentation page for compatibility info | ||
| val html = URL("https://kotlinlang.org/docs/gradle-configure-project.html").readText() |
There was a problem hiding this comment.
yes! ive been looking for this documentation justification for raising out minimum kotlin version compatibility. will ping you separately about this
| val html = URL("https://kotlinlang.org/docs/gradle-configure-project.html").readText() | ||
| val doc = Jsoup.parse(html) | ||
|
|
||
| // Look for the compatibility table |
There was a problem hiding this comment.
this makes us dependent on the structure of the page. hopefully it is stable🤞
There was a problem hiding this comment.
yeah that's not ideal but I think it will stay like that for a while. Otherwise we'd have to find an alternative (like looking at the kotlin github repo perhaps)
| # Kotlin code style for this project: "official" or "obsolete": | ||
| kotlin.code.style=official | ||
| # For AGP matrix tests, we can't infer the correct Gradle version for pre-releases | ||
| android.overrideVersionCheck=true |
There was a problem hiding this comment.
What exactly does this do? It seems to me that it checks that the running Gradle version is compatible with AGP version?
Why do we need this in the parent build? Is it just while we are running the entire build with different versions of Gradle?
There was a problem hiding this comment.
Is it just while we are running the entire build with different versions of Gradle?
yep that's the reason! Was failing here without that flag: https://github.com/getsentry/sentry-android-gradle-plugin/actions/runs/14733865730/job/41354917196?pr=873
| @@ -17,6 +17,7 @@ kotlin = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" } | |||
| kotlinAndroid = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" } | |||
| kotlinSpring = { id = "org.jetbrains.kotlin.plugin.spring", version.ref = "kotlin" } | |||
| kapt = { id = "org.jetbrains.kotlin.kapt", version.ref = "kotlin" } | |||
There was a problem hiding this comment.
do we still need kapt?
There was a problem hiding this comment.
yep, it's used in the compiler plugin for AutoService
Co-authored-by: Nelson Osacky <nelson.osacky@sentry.io>
📜 Description
💡 Motivation and Context
To proactively test against newest AGP and Gradle versions
💚 How did you test it?
📝 Checklist
🔮 Next steps