Build the plugin that's fit for "IDEA Ultimate" and "IDEA Community"

Answered

Hi.

I have developed a plugin using the module "com.intellij.spring" which can be used in IDEA Ultimate. The Gradle is used in my Project. Recently, there is an idea that we need the plugin can be used in the "IDEA Community". Therefore, Two problems come into the world:

1. How can I make the code compiles successfully?

    The module, "com.intellij.spring", is hardcoded in the plugin. Without it, the plugin can't compile successfully using Gradle. Because of that,  I can't debug my plugin when running in the "IDEA Community".

So I try to add the plugin back, but ...

2. How can I judge whether the module, "com.intellij.spring", is loaded in the user's IDEA?

   

 

10 comments
Comment actions Permalink

You can set a dependency to Spring in plugin.xml as an optional and put functionality related to this package in there – i.e., a specific Extension Point using Spring's code. Check the Optional Plugin Dependencies for more information.

That way, you will make the plugin working with IU and IC – and IC will have limited features because of the missing Spring plugin.

1
Comment actions Permalink

Spring is not available as a standalone plugin, so you have to target IU.

0
Comment actions Permalink

Jakub Chrzanowski I didn't understand your last comment. Are you saying that your suggestion was wrong and it's not possible to support both IC and IU at the same time if you need to depend on the JavaScriptLanguage module for example?

I'm developing a plugin which needs to display gutter icons for Java, Kotlin, Javascript and Typescript files at the same time using `codeInsight.lineMarkerProvider` extension point.

My plugin should work in both Android Studio (Java, Kotlin) and Ultimate edition (Javascript and Typescript).

This is how my `gradle.properties` configuration looks now:

```

pluginGroup=com.example.my_plugin
pluginName=Example lugin
pluginVersion=0.0.1
pluginSinceBuild=193
pluginUntilBuild=230.*
platformType=IC
platformVersion=2020.3.2
platformDownloadSources=true

platformPlugins=com.intellij.java, org.jetbrains.kotlin, JavaScriptLanguage

Any advice?

0
Comment actions Permalink

Yann Cebron Do you know if what I described is doable?

0
Comment actions Permalink

Vovahost Yes, again, using optional dependencies for each plugin/target language as described above.

0
Comment actions Permalink

Yann Cebron Thank you for getting back. What platform do I set the in `platformType`? 
If I use `IC` then it fails to build because it can't find `JavaScriptLanguage` plugin in `platformPlugins` as it's only supported in IU edition.
If I use `IU` then it will build but I will not be able to install my Plugin in Intellij Community edition.

0
Comment actions Permalink

You must build against Ultimate. All functionality that is available only in IJ Ultimate must be separated in optional plugin descriptor, so it will load only if available and keep working (without that functionality) in IJ Community.

1
Comment actions Permalink

Yann Cebron What you suggested works great. What if I want my plugin to also work in App Code?

I was thinking to add a 

<depends config-file="com.example.myplugin-withAppCode.xml" optional="true">com.intellij.appcode</depends>

The problem now I have is that `com.intellij.appcode` is not recognized and setting `platformType=IU` is not working anymore because Intellij Idea Ultimate doesn't support Swift, only AppCode does.

Any suggestions?

 

0
Comment actions Permalink

It's currently not possible to build plugins that support both AppCode and IntelliJ IDEA. You'll need to build two separate plugins.

0
Comment actions Permalink

Thank you Yann, I'll drop the support for AppCode for now. Too much hustle.
They need to simplify this.

0

Please sign in to leave a comment.