Is it known issue that if compile plugin against 2024.2 and up, then plugin is not able to run under 2024.2 and below when com.intellij.openapi.util.registry.Registry class used, due to it migration form java to Kotlin (static filed into Companion)?
That’s quite serious issue…
Cause I would prefer to build against latest prod IDE version (251 currently), to be sure code is compatible with most used IDE version now.
But in that case I can’t have sinceBuild below 242 (where such breaking changes been made)… @yann.cebron please, any ideas?
Always build against the earliest supported version (i.e. the since-build version). A newer SDK can provide binary compatibility for earlier versions, but the reverse is not possible. Then use the plugin verifier to verify the build against since-build with later versions.
Unfortunately, building against lowest supported version not guaranteeing compatibility with all lastest versions.
We have cases when some classes/methods been just removed in later versions and that leads to ClassNotDefined exception.
That’s why idea is to build against most used version (current release) and manually check compatibility with other versions.
Then you should make builds for each major version, either based on branches or a Gradle setup per major version.
As you can see, building against the latest version has problems and building against the earliest version may create problems, too.
iirc JetBrains developers recommended building against the earliest version if you support multiple major versions.
When relying on only stable API I haven‘t seen removal of methods for a long time.
But overall, I have found build-per-major-version much better to handle than everything else. It‘s much better and more stable than desperate workarounds with reflection or anything else not recommended by JetBrains.