IntelliJ Platform Plugin SDK Help

Plugins

The IntelliJ Platform Gradle Plugin consists of sub-plugins which should be applied depending on the project structure.

Subplugins architecture allows applying a subset of features, for example, to provide the IntelliJ Platform dependency to a project submodule without creating unnecessary tasks.

The following diagram describes dependencies between plugins provided with the IntelliJ Platform Gradle Plugin.

build.gradle.kts

Platform

Module

Base

Migration

settings.gradle.kts

Settings

Platform

Plugin ID: org.jetbrains.intellij.platform

This is a top-level plugin that applies all the tooling for plugin development for IntelliJ-based IDEs. It should be used only with the root module (for submodules, see Module).

build.gradle.kts

plugins { id("org.jetbrains.intellij.platform") version "2.1.0" }

build.gradle.kts

plugins { id("org.jetbrains.intellij.platform") version "2.1.0" }

Available tasks

buildPlugin, buildSearchableOptions, composedJar, generateManifest, initializeIntelliJPlatformPlugin, instrumentCode, instrumentedJar, jarSearchableOptions, patchPluginXml, prepareSandbox, prepareTest, printBundledPlugins, printProductsReleases, publishPlugin, runIde, setupDependencies, signPlugin, testIdePerformance, testIde, testIdeUi, verifyPluginProjectConfiguration, verifyPluginSignature, verifyPluginStructure, verifyPlugin

Module

Plugin ID: org.jetbrains.intellij.platform.module

This plugin applies a smaller set of functionalities for compiling and testing submodules when working in a multi-module architecture.

Compared to the main plugin, it doesn't contain tasks related to publishing or running the IDE for testing purposes.

settings.gradle.kts

rootProject.name = "..." include(":submodule")

submodule/build.gradle.kts

plugins { id("org.jetbrains.intellij.platform.module") } repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { intellijIdeaCommunity("2024.3 EAP") } }

build.gradle.kts

plugins { id("org.jetbrains.intellij.platform") version "2.1.0" } repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { intellijIdeaCommunity("2024.3 EAP") pluginModule(implementation(project(":submodule"))) } }

settings.gradle

rootProject.name = '...' include ':submodule'

submodule/build.gradle

plugins { id 'org.jetbrains.intellij.platform.module' } repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { intellijIdeaCommunity '2024.3 EAP' } }

build.gradle

plugins { id 'org.jetbrains.intellij.platform' version '2.1.0' } repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { intellijIdeaCommunity '2024.3 EAP' pluginModule(implementation(project(':submodule'))) } }

Note that the :submodule is added both to the implementation configuration and intellijPlatformPluginModule using the Plugins helper method. This guarantees that the submodule content will be merged into the main plugin JAR file.

Available tasks

composedJar, generateManifest, initializeIntelliJPlatformPlugin, instrumentCode, instrumentedJar, prepareSandbox, prepareTest, printBundledPlugins, printProductsReleases, setupDependencies, testIde, verifyPluginProjectConfiguration

Settings

Plugin ID: org.jetbrains.intellij.platform.settings

If you define project repositories within the settings.gradle.kts using the dependencyResolutionManagement, make sure to include the Settings plugin in settings.gradle.kts.

This approach allows for omitting the repositories {} definition in the build.gradle.kts files. See Dependency Resolution Management for more details.

settings.gradle.kts

import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform plugins { id("org.jetbrains.intellij.platform.settings") version "2.1.0" } rootProject.name = "..." dependencyResolutionManagement { repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS repositories { mavenCentral() intellijPlatform { defaultRepositories() } } } include(":submodule")

build.gradle.kts

plugins { id("org.jetbrains.intellij.platform") } dependencies { intellijPlatform { intellijIdeaCommunity("2024.3 EAP") pluginModule(implementation(project(":submodule"))) } }

submodule/build.gradle.kts

plugins { id("org.jetbrains.intellij.platform.module") } dependencies { intellijPlatform { intellijIdeaCommunity("2024.3 EAP") } }

settings.gradle

import org.jetbrains.intellij.platform.gradle.extensions.intellijPlatform plugins { id 'org.jetbrains.intellij.platform.settings' version '2.1.0' } rootProject.name = '...' dependencyResolutionManagement { repositoriesMode = RepositoriesMode.FAIL_ON_PROJECT_REPOS repositories { mavenCentral() intellijPlatform { defaultRepositories() } } } include ':submodule'

build.gradle

plugins { id 'org.jetbrains.intellij.platform' } dependencies { intellijPlatform { intellijIdeaCommunity '2024.3 EAP' pluginModule(implementation(project(':submodule'))) } }

submodule/build.gradle

plugins { id 'org.jetbrains.intellij.platform.module' } dependencies { intellijPlatform { intellijIdeaCommunity '2024.3 EAP' } }

Migration

Plugin ID: org.jetbrains.intellij.platform.migration

The Migration plugin is designed to assist in upgrading projects that use Gradle IntelliJ Plugin 1.x to the 2.x version. To prevent Gradle failing due to breaking changes, the org.jetbrains.intellij.platform.migration plugin was introduced to fill missing gaps and provide migration hints.

It loads the Platform plugin with additional mocks and checks applied — after the successful migration, the org.jetbrains.intellij.platform.migration identifier shoud be replaced with org.jetbrains.intellij.platform.

See Migrating from Gradle IntelliJ Plugin (1.x) for more details.

Base

Plugin ID: org.jetbrains.intellij.platform.base

Prepares all the custom configurations, transformers, and base tasks needed to manage the IntelliJ Platform dependency, JetBrains Runtime, CLI tools, and others.

It also introduces the IntelliJ Platform Extension to the build.gradle.kts file along with Dependencies Extension and Repositories Extension to help preconfigure project dependencies:

repositories { ... // Repositories Extension intellijPlatform { ... } } dependencies { ... // Dependencies Extension intellijPlatform { ... } } // IntelliJ Platform Extension intellijPlatform { ... }
repositories { ... // Repositories Extension intellijPlatform { ... } } dependencies { ... // Dependencies Extension intellijPlatform { ... } } // IntelliJ Platform Extension intellijPlatform { ... }

The plugin also introduces a task listener which allows for creating custom tasks decorated with Task Awares. See Recipes for more details.

Available tasks

initializeIntelliJPlatformPlugin, printBundledPlugins, printProductsReleases, setupDependencies,

Last modified: 02 October 2024