How can we declare a plugin compatible with future versions?

Answered

We have a plugin which only declares 

intellij {
  version.set("2024.1")
}

no untilBuild etc.

As I understand  https://plugins.jetbrains.com/docs/intellij/build-number-ranges.html this means the plugin should be compatible with future versions of IntelliJ: ""Not specifying until-build means it will include all future builds. This includes future, yet unreleased versions and possibly new IDEs".

However, what we observe is that the plugin becomes incompatible every time a new IDE version is released, and we'll need to release a new version of the plugin to support it (with no other changes than updating "version.set" as above). How can we avoid this?


 

1
4 comments

The attribute version sets both since and until build values:

For example, the default values for the attributes patchPluginXml.sinceBuild and patchPluginXml.untilBuild are defined based on the declared (or default) value of intellij.version. So by default patchPluginXml.sinceBuild and patchPluginXml.untilBuild are substituted into the <idea-version> element's since-build and until-build attributes in the plugin.xml file.

Source: https://plugins.jetbrains.com/docs/intellij/configuring-plugin-project.html#patching-the-plugin-configuration-file  

0

Thanks for your response. 

So,  to conclude, “Not specifying until-build means it will include all future builds.” only holds if intellij.version - which is mandatory - is not specified?

Is there some other way to ensure a plugin stays compatible?

0

Have you tried explicitly specifying sinceBuild and setting untilBuild to null?

This here worked in an older version of my plugin:

patchPluginXml {
    changeNotes '''
      <ul>
      <li>Update for newer IntelliJ versions.</li>
      </ul>
      '''
    sinceBuild '212.5'
    untilBuild null
}

https://github.com/Bradan/intellij-purebasic/blob/01e744adc674a820bcdfe66abf3e05a55a53e0cc/build.gradle#L54

However I switched to gradle.build.kts and didn't try it there, yet. If it doesn't work you can always patch the plugin xml yourself. If you want to automate it, you can add a custom gradle task for that purpose.

0

For anyone wondering how to do it you can do this:

patchPluginXml {
    // all your other settings
    untilBuild.set(provider { null })
}

Source: https://plugins.jetbrains.com/docs/intellij/tools-intellij-platform-gradle-plugin-tasks.html#patchPluginXml-untilBuild

0

Please sign in to leave a comment.