IntelliJ Platform Plugin SDK Help

Migrating from Gradle IntelliJ Plugin (1.x)

Plugin Name Change

As the 2.x branch brings significant breaking changes to the plugin, the name was changed from Gradle IntelliJ Plugin to IntelliJ Platform Gradle Plugin as the old one was confused with the bundled Gradle support plugin in the IDE.

The plugin is published to the Gradle Plugin Portal with a new name as a new entry, and the old one is marked as deprecated.

Minimum Gradle and Java Versions

The minimum required Gradle version is now 8.2 running on Java 17 or later. See Requirements.

Plugin ID Change

Plugin ID has changed from org.jetbrains.intellij to org.jetbrains.intellij.platform. To apply it, use:

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

Migration Plugin

The 2.x release introduces multiple Plugins, featuring a dedicated one to help with migration from Gradle IntelliJ Plugin 1.x: Migration.

When you apply the Plugin ID Change, Gradle will fail to process the build.gradle.kts file as the old intellij {} Extension doesn't exist anymore. To fill all gaps and help users figure out required changes - right in the IDE - the org.jetbrains.intellij.platform.migration plugin was introduced:

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

intellij {} Extension

The intellij {} extension is no longer available and was replaced with intellijPlatform {}. Note that the available properties differ, see IntelliJ Platform Extension for details.

intellij.pluginName

Use: intellijPlatform.pluginConfiguration.name:

intellijPlatform { pluginConfiguration { name = ... } }

intellij.type, intellij.version

Define the IntelliJ Platform dependency in dependencies{} block:

repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { create(type, version) } }

See: Dependencies Extension

intellij.plugins

The intellij.plugins property is no longer available.

Define dependencies on plugins or bundled plugins in dependencies {} block instead:

Example:

Setting up dependencies on comma-separated plugins listed in platformPlugins and platformBundledPlugins properties from gradle.properties.

repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { plugins(providers.gradleProperty("platformPlugins").map { it.split(',') }) bundledPlugins(providers.gradleProperty("platformBundledPlugins").map { it.split(',') }) } }

See:

intellij.localPath

Define dependencies on local IDE instance in dependencies {} block:

repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { local(localPath) } }

See: Custom Target Platforms

intellij.updateSinceUntilBuild, intellij.sameSinceUntilBuild

The since/until properties in the plugin.xml file are now managed by the intellijPlatform extension.

intellij.intellijRepository, intellij.pluginsRepositories, intellij.jreRepository

intellij.sandboxDir

Use the intellijPlatform.sandboxContainer.

Use the repositories {} block to manage repositories instead.

See: Repositories Extension

intellij.downloadSources

Downloading sources is managed by the Plugin DevKit plugin in version 2024.1+.

intellij.ideaDependency

Access the ProductInfo object using the intellijPlatform.productInfo property.

Tasks

Running Tests

An explicit dependency on a test framework is now required.

downloadRobotServerPlugin

The Robot Server Plugin can now be downloaded using plugins { robotServerPlugin() } dependency helper when declaring a custom task.

runIdeForUiTests

The runIdeForUiTests task is obsolete and should be replaced with an explicit declaration.

The task running IDE with the Robot Server Plugin should be declared now as a custom runIde task with plugin loaded:

val runIdeForUiTests by intellijPlatformTesting.runIde.registering { task { jvmArgumentProviders += CommandLineArgumentProvider { listOf( "-Drobot-server.port=8082", "-Dide.mac.message.dialogs.as.sheets=false", "-Djb.privacy.policy.text=<!--999.999-->", "-Djb.consents.confirmation.enabled=false", ) } } plugins { robotServerPlugin() } }
val runIdeForUiTests by intellijPlatformTesting.runIde.registering { task { jvmArgumentProviders.add({ [ '-Drobot-server.port=8082', '-Dide.mac.message.dialogs.as.sheets=false', '-Djb.privacy.policy.text=<!--999.999-->', '-Djb.consents.confirmation.enabled=false', ] } as CommandLineArgumentProvider) } plugins { robotServerPlugin() } }

runPluginVerifier

The task for running the IntelliJ Plugin Verifier is now called verifyPlugin.

Use intellijPlatform.pluginVerification extension to configure it.

setupDependencies

To make the IntelliJ SDK dependency available in the IDE, the setupDependencies task was provided by Gradle IntelliJ Plugin 1.x. This task is no longer required, but when switching from 1.x, Gradle may still want to execute it in the afterSync phase.

To completely drop this approach, it is mandatory to remove its reference manually in the IDE.

Removing 'setupDependencies' Task

  1. Open Gradle Tool Window

  2. Right-click on the main module and select Tasks Activation

  3. In the Tasks Activation modal window, find and remove the setupDependencies entry.

    Alternatively, edit the .idea/workspace.xml file and remove the setupDependencies entry.

    Other

    Unresolved 'idea-ext' Plugin

    Add an explicit dependency on the plugin in build.gradle.kts:

    plugins { id("org.jetbrains.gradle.plugin.idea-ext") version "1.1.9" }
    plugins { id 'org.jetbrains.gradle.plugin.idea-ext' version '1.1.9' }
    Last modified: 02 October 2024