Development

Last modified 30 Sep 2021 10:06 +02:00

To start Intellij Idea Plugin development it’s a must to read through Intellij Platform SDK. Platform SDK documentation is not very long, but it gives great overview on what can be found where and how plugins works internally.

Project Modules

midpoint-client-prism

REST client for MidPoint REST API using prism internally. Not finished yet and currently not used in plugin. Previous plans were to use this intelligent client which would provide additional error checks, parsing and so on. However after first implementation iterations it was thrown away. Users of plugin (midpoint engineers) wanted to be sure what was send or received from MidPoint via REST API therefore currently no parsing is happening when downloading/uploading objects.

studio-idea-plugin

Main implementation of Intellij Plugin. Overview of packages:

  • studio-idea-plugin/src/main/resources/META-INF/plugin.xml Plugin descriptor, contains definition of all UI actions, components, services and all extension points that this plugin implements.

  • studio-idea-plugin/src/main/java/com/evolveum/midpoint/studio/impl/client Package containing REST implementation used for communication between plugin and midpoint. This REST client uses okhttp library.

  • studio-idea-plugin/src/main/java/com/evolveum/midpoint/studio/action Contains all UI actions defined in plugin descriptor. Most of these actions can be seen as buttons in UI on different toolbars or panels.

  • studio-idea-plugin/src/main/java/com/evolveum/midpoint/studio/impl Core implementation of MidPoint plugin. From services that handle properties encryption, environments management, project settings and module/facet setup.

  • studio-idea-plugin/src/main/java/com/evolveum/midpoint/studio/impl/lang and studio-idea-plugin/src/main/java/com/evolveum/midpoint/studio/impl/psi Packages contains most of the implementation for different extension points from IDE. They are used for code completion, injection of groovy variables, validation, annotations and properties inlay.

  • studio-idea-plugin/src/main/java/com/evolveum/midpoint/studio/ui Main package containing most of UI elements, toolbars and panels for different features like object browser, trace viewer, remote diff and others.

  • studio-idea-plugin/src/main/java/com/evolveum/midpoint/studio/ui/trace Trace UI, used to visualize information obtained from tracing midpoint operations (e.g. recompute, reconcile or tasks).

Planned Modules

Preliminary plans expect that command line equivalent of Studio Plugin will be created. It should support upload/download with property placeholders expansion (plain and encrypted). To be defined later.

Development Basics

Project is build using Gradle. Main tasks to build project:

  • buildPlugin

  • runPluginVerifier

  • runIde

  • publishPlugin

Useful options for gradle:

  • -Dorg.gradle.project.gitLocalBranch=snapshot

    • posible options [snapshot/stable]

  • -Dorg.gradle.project.buildNumber=20

    • used to simulate jenkins build numbers

  • studio_intellijPublishToken

    • system environment variable used with publishPlugin for publishingp plugin to JetBrains Marketplace. Contains publish token (authentication). This can be obtained on JetBrains MarketPlace.

Examples

./gradlew buildPlugin runPluginVerifier --warning-mode all -s -Dorg.gradle.project.gitLocalBranch=snapshot -Dorg.gradle.project.buildNumber=20