Plugin Icon is searched in the wrong place if the distribution file for the plugin is a ZIP file
The documentation states that the pluginIcon.svg should be in the META-INF directory with the plugin.xml file. http://www.jetbrains.org/intellij/sdk/docs/basics/plugin_structure/plugin_icon_file.html
However, if the distribution of the plugin is a ZIP file then the ZIP is extracted to a directory (on OS X in Library/Application Support/...) with the name of the plugin.
The code in the IDE checks if the plugin path is a directory and looks for META-INF/pluginIcon.svg in that path, but in the case of ZIP dist file the plugin directory will contain only a lib directory with the plugin jar in it which contains the META-INF/pluginIcon.svg. So the plugin icon will not be found, unless the ZIP distribution file contains META-INF directory with pluginIcon.svg in it.
Is this an issue with the built in plugin ZIP artifact creation, the plugin icon search logic or the documentation should be changed to reflect that plugin ZIP distribution files should have META-INF/pluginIcon.svg?
Please sign in to leave a comment.
The pluginIcon.svg file should be in the same place as plugin.xml file. In the case of ZIP archive, icons will be looked for in the META-INF folder from lib/*.jar. You don't need to additionally have META-INF/pluginIcon.svg in ZIP distribution.
In your plugin (https://plugins.jetbrains.com/plugin/11301-arduino-support) everything is correct. The icons are not shown in the IDEs and the plugins repository because this feature has not yet been released. However, you can check, that your icons were uploaded via API https://plugins.jetbrains.com/api/icon?pluginId=com.vladsch.clionarduinoplugin or https://plugins.jetbrains.com/api/icon?pluginId=com.vladsch.clionarduinoplugin&theme=DARCULA.
Lidiya, glad to hear that the plugins website does the processing properly.
My comment was about the IDE, 2019 code from intellij-community master branch. I opened an issue on YouTrack and patched my code for the fix.
Before the fix only a few plugins showed icons (the ones with jar distribution file and mine where I added the META-INF/*.svg to the ZIP root):
After the fix a lot more plugins showed icons, including JetBrains bundled ones: Kotlin, Groovy, Gradle, GitIntegration, Scala.
Vladimir, thank you for the creating issue and sorry for a slight misunderstanding.
No need to apologize. I really was glad to hear that the website is processing the ZIP distributions correctly because this question was on my mind.
I was going to upload my MissingInActions plugin zip with the META-INF/ in the zip root as a test but could not because there were issues with logging into JetBrains sites yesterday. Now I know I don't need to do it.