Hello
I am currently developing a plugin that targets multiple versions of IntelliJ IDEA (2021.3 through 2024.1) & I am running into challenges managing conditional dependencies in the build.gradle.kts
file.
Some dependencies are only available or compatible with specific IDE versions & applying them globally leads to runtime errors or build failures on older versions. Has anyone successfully implemented conditional logic in Gradle to handle this kind of multi-target support?
I have explored using simple if
conditions in the dependencies
block based on intellij.version
; but this approach seems brittle and doesn’t scale well when targeting several versions with slightly differing APIs.
I am curious if there’s a cleaner or more idiomatic Gradle/Kotlin DSL approach perhaps using custom Gradle properties, version mapping / helper functions within the script. Bonus if it works cleanly with the IntelliJ Gradle Plugin and supports tasks like
runIde
per version. Checked IntelliJ Platform Gradle Plugin (2.x) | IntelliJ Platform Plugin SDK documentation guide for reference.
If anyone has a sample script, best practices / a public repo that demonstrates managing plugin dependencies based on IntelliJ platform version, I would love to see it. How tools like QlikView handle compatibility across data sources; understanding what is QlikView helps draw parallels in managing version-specific dependencies in Gradle.
Also; is there a preferred strategy for setting up automated CI to test builds against multiple IntelliJ versions using this plugin system?
Thanks in advance!