Plugin verifier fails for optional dependency on 'com.intellij.modules.pycharm.community'

I have some EPs that should only be instantiated in a Community Edition IDE. I’ve added the following to plugin.xml:

<depends optional="true" config-file="plugin-ce.xml">com.intellij.modules.idea.community</depends>
<depends optional="true" config-file="plugin-ce.xml">com.intellij.modules.pycharm.community</depends>

The plugin verifier is failing with:

Missing dependencies (1)

  • module com.intellij.modules.pycharm.community (optional): Dependency ‘module com.intellij.modules.pycharm.community (optional)’ is not resolved.

I’ve tried adding com.intellij.modules.pycharm.community to platformBuildPlugins in gradle.properties, but that fails with:

Could not find bundled plugin with ID: ‘com.intellij.modules.pycharm.community’.

Any thoughts on how to resolve this?

Hi!

Have you tried PythonCore plugin?

When you declare depends and dependencies it would be better to have such dependency. So dependencies are installed with plugins and bundledPlugins.

The way for you is:

  • Install PythonCore plugin
  • Declare depends
  • Re-sync gradle
  • Develop

Let me know if it works :grinning:

The use case is different. Here we probably want to limit features depending on IDE edition

I tried adding PythonCore to platformPlugins as follows:

platformPlugins=PythonCore:<version>

and Gradle was able to resolve that as a dependency. However, the plugin verifier still fails with a missing dependency for com.intellij.modules.pycharm.community.

As @yuriy.artamonov notes, this is just being done so that I can have optional dependencies in plugin.xml for both IntelliJ IDEA Community Edition and PyCharm Community Edition where it’s supplementing behavior that’s already present in any commercial IDE.

@yuriy.artamonov, this approach for expressing CE dependencies is based on our discussion a few months back in Slack, and it’s worked just fine in my other Ant-based plugin project that’s built against IntelliJ IDEA Ultimate Edition. However, this is a different Gradle-based project that’s built against IntelliJ IDEA Community Edition. Is there no way to express the same build dependency so that the plugin.xml optional dependency resolves properly?