plugin-verifier and optional dependencies
To support most IntelliJ-based IDE's with my plugin, I made the dependencies of com.intellij.modules.java "optional". Now I tried to see what the plugin-verifier tells me about it. I tested my plugin against PyCharm, where the java dependency is not available. That shouldn't be a problem because in the case of my plugin this mainly includes the dependencies of setting up the module-structure within a project and now, these extensions are made optional. I ran
java -jar verifier-cli-1.210-all.jar -runtime-dir /usr/local/java/jdk1.8.0_181/ \
check-plugin build/distributions/Wolfram-IntelliJ-Plugin-2019.2.zip \
~/workspace/JetBrains/Toolbox/apps/PyCharm-P/ch-0/192.5728.105
The output of the plugin-verifier, however, gave me problems like this
Some problems might have been caused by missing dependencies:
module com.intellij.modules.java (optional): Dependency module com.intellij.modules.java (optional) is neither resolved among bundled plugins of PY-192.5728.105, nor is there compatible version available in Plugin Repository https://plugins.jetbrains.com
Against PY-192.5728.105 the plugin de.halirutan.mathematica:2019.2 has 0 warnings
Against PY-192.5728.105 the plugin de.halirutan.mathematica:2019.2 has 7 problems
#Access to unresolved class com.intellij.platform.templates.BuilderBasedTemplate
These are exactly the classes that are used by the extensions that I have put into the optional dependency like this
<depends optional="true" config-file="withJavaModule.xml">com.intellij.modules.java</depends>
and the withJavaModule.xml contains
<idea-plugin>
<extensions defaultExtensionNs="com.intellij">
<moduleConfigurationEditorProvider implementation="de.halirutan.mathematica.module.ui.WLModuleConfigurationEditor"/>
<projectTemplatesFactory implementation="de.halirutan.mathematica.module.WLProjectTemplatesFactory"/>
</extensions>
</idea-plugin>
I must be doing something wrong or otherwise, I don't understand why the verifier still complaints. Can someone give me a clue?
Please sign in to leave a comment.
Hello, Patrick
You are doing everything right. It is the Plugin Verifier that produces false-positive warnings. Your plugin is compatible with PY charm.
Here the corresponding ticket that is addressed to improve analysis of missing optional dependencies: https://youtrack.jetbrains.com/issue/MP-1735.
Once implemented, the verifier will be intelligent enough not to complain in this case.
It requires additional static analysis to ensure that Java-plugin classes are not accessed from classes of the base part of the plugin, so Plugin Verifier checks everything just in case.
Thanks for using Plugin Verifier and reporting this. The issue will be addressed soon.
Thanks Sergey! After going to bed last night, I was thinking exactly about what the verifier needs to do in order to analyse which classes/methods are actually called during runtime. The YT issue you linked hits exactly the nail.
The verifier is absolutely great because it helps me to find places where I might have used classes that are not available outside IDEA. Great job.
Thanks for the feedback!
You probably know that instead of running the Plugin Verifier as a command line tool you can navigate to a plugin's version page (e.g. https://plugins.jetbrains.com/plugin/7232-wolfram-language/update/66500), scroll to the bottom and schedule verification of that version against a specific IDE build. The verification will be performed remotely and you won't have to download IDE locally.