Skip to content

JetBrains IntelliJ Plugin

nikomall34 edited this page Jan 27, 2024 · 8 revisions

JetBrains offers a guide on how to develop plugins: JetBrains Plugin Development guide. It suggests to use either IntelliJ IDEA Community Edition or IntelliJ IDEA Ultimate for developing plugins which can be found here using the Gradle platform. The main ways to start creating a Gradle Plugin are:

  • The dedicated generator in IntelliJs New Wizard which creates a minimal plugin: guide
  • The IntelliJ Plugin Platform Template found on GitHub which includes the required project files in addition to a configuration for the GitHub Actions CI workflows: guide

Gradle-based Plugin: structure and requirements

Structure

my_plugin
├── .run
│   └── Run IDE with Plugin.run.xml
├── gradle
│   └── wrapper
│       ├── gradle-wrapper.jar
│       └── gradle-wrapper.properties
├── src
│   └── main
│       ├── kotlin
│       └── resources
│           └── META-INF
│               ├── plugin.xml
│               └── pluginIcon.svg
├── .gitignore
├── build.gradle.kts
├── gradle.properties
├── gradlew
├── gradlew.bat
└── settings.gradle.kts

Elements of a plugin

Requirements (Plugin User Experience)

  • Ease of use
  • Stability
    • Functional tests are required
    • An issue tracker for users to report bugs
  • Performance (well optimized)
  • Small plugin size (including dependencies)
  • Consistent in terms of behavior and design (UI)
  • High quality UI texts
  • Clear description of the plugin

Things we need to discuss

  • group-name: e.g. com.amos.mutationmate
  • artifact: e.g. PIT mutationmate
  • default is kotlin, but we may add java support (JDK 11 or 17)

How to Upload a Plugin and Get It Approved on JetBrains Marketplace (Webinar)

How to upload the Plugin

  • Sign in to JetBrains Marketplace.
  • Build the plugin. Then in the user account, it can be uploaded as a .zip or .jar file.
  • It is better to upload the .zip file (which can be found in build/distributions) since it contains all the dependencies
  • A custom page can be created to add steps on how to download and use the plugin.

How to get it approved

The following 4 steps are done by the JetBrains Team to check if a plugin can be approved or not.

  • Auto-checks: Verify the archive file for criteria such as invalid parameters, incorrect archive structure, and dependency issues.
  • Plugin Verifier: Checks binary compatibility, API usages, parameter validity, and dynamic loadability between IntelliJ IDEA and the plugin. One should run the plugin against the verifier locally before uploading.
  • Manual Review: Essential to manually check the plugin during the moderation process.
  • Auto-Test: Installs the plugin and checks for exceptions during regular workflow. This auto-test can be set up locally by reaching out to the support team.

Common Rejection Reasons

  • The Plugin's functionality is not clearly shown in the screenshots.
  • Plugin description lacking clarity. The description should be in English, with the option for other languages in subsequent chapters.
  • Compatibility issues reported by Plugin Verifier (run it locally before uploading the plugin). It is also possible to run the Plugin Verifier as an github-action. The gradle task is runPluginVerifier
  • The tags used are not suitable for the plugin.
  • Use of a default logo.
  • Source code is not publicly available.
  • Inappropriate plugin name (the name should be unique, short and relevant).
  • Incorrect use of change notes (dont't use notes from the plugin template).

Upload an update of the plugin

  • Adjust the version in the build.gradle.kts file:
version = "Write current version here"
  • Adjust the version in the plugin.xml file and write down what changed in the current version:
<change-notes><![CDATA[
  <p>What changed in current version</p>
]]></change-notes>
<version>Current Version</version>
  • Run the buildPlugin gradle task.
  • Go to the website of the plugin. (The Link will be provided by the JetBrains Team after publishing the plugin)
  • On the website click on "Edit". After being in edit-mode click on "Upload Update".
  • Now you can choose the newly created .zip file of the plugin and upload it.

Here is the recording of the webinar.

How to change the development IDE to the modern IntelliJ appearance

  1. Make sure the IntelliJ development IDE is on the newest version by navigating to Main -> About Main. Here it should say IntelliJ IDEA 2023.*.
  2. In the delevopment IDE change the setting by navigating to Main -> Settings -> checking Enable new UI. Then restart the development IDE.