IntelliJ Platform Plugin SDK Help

Dependencies Extension

IntelliJ Platform Gradle Plugin enhances the dependencies {} configuration block by applying a nested dependencies.intellijPlatform {} extension.

This class provides methods for adding dependencies to different IntelliJ Platform products and managing local dependencies.

It also includes methods for adding plugins (including bundled), JetBrains Runtime, as well as tools like IntelliJ Plugin Verifier and Marketplace ZIP Signer.

Example:

  • setup Maven Central and defaultRepositories()

  • target IntelliJ IDEA Community 2024.1.2

  • add dependency on the bundled Java plugin

  • add IntelliJ Plugin Verifier, Marketplace ZIP Signer CLI, and code instrumentation tools

  • add Test Framework for testing plugin with JUnit4

repositories { mavenCentral() intellijPlatform { defaultRepositories() } } dependencies { intellijPlatform { intellijIdeaCommunity("2024.1.2") bundledPlugin("com.intellij.java") pluginVerifier() zipSigner() instrumentationTools() testFramework(TestFrameworkType.Platform.JUnit4) } // other dependencies, e.g., 3rd-party libraries }

Target Platforms

Default Target Platforms

See Custom Target Platforms for non-default targets.

Function

Description

androidStudio(version)

Android Studio

aqua(version)

Aqua

clion(version)

CLion

datagrip(version)

DataGrip

dataspell(version)

DataSpell

fleetBackend(version)

Fleet Backend

gateway(version)

Gateway

goland(version)

GoLand

intellijIdeaCommunity(version)

IntelliJ IDEA Community

intellijIdeaUltimate(version)

IntelliJ IDEA Ultimate

mps(version)

MPS

phpstorm(version)

PhpStorm

pycharmCommunity(version)

PyCharm Community

pycharmProfessional(version)

PyCharm Professional

rider(version)

Rider

rubymine(version)

RubyMine

rustrover(version)

RustRover

webstorm(version)

WebStorm

writerside(version)

Writerside

Custom Target Platforms

Function

Description

create(type, version)

Adds a configurable dependency on the IntelliJ Platform. See Parametrize IntelliJ Platform Dependency.

local(localPath)

Adds a dependency on a local IntelliJ Platform instance. See Local IntelliJ Platform IDE Instance.

See also:

Plugins

Function

Description

bundledPlugin(id)

Adds a dependency on a bundled IntelliJ Platform plugin.

bundledPlugins(ids)

Adds dependencies on bundled IntelliJ Platform plugins.

plugin(id, version, channel)

Adds a dependency on a plugin for IntelliJ Platform.

plugin(notation)

Adds a dependency on a plugin for IntelliJ Platform using a string notation:

pluginId:version or pluginId:version@channel

plugins(notations)

Adds dependencies on plugins for IntelliJ Platform using a string notation:

pluginId:version or pluginId:version@channel

See also:

Testing

To implement tests for IntelliJ Platform plugin, it is necessary to explicitly add a dependency on the test-framework library containing the necessary test base classes. In most cases, the Platform.JUnit4 variant will be used:

import org.jetbrains.intellij.platform.gradle.TestFrameworkType dependencies { intellijPlatform { testFramework(TestFrameworkType.Platform.JUnit4) } }

The provided testFramework(type, version) helper method makes it possible to add the base artifact to the test classpath or its variants, such as Java, Go, ReSharper, etc.

Function

Description

testFramework(type, version)

Adds a dependency on Test Framework or its variant using TestFrameworkType type.

See also:

Tools

Function

Description

pluginVerifier(version)

Adds a dependency on IntelliJ Plugin Verifier.

zipSigner(version)

Adds a dependency on Marketplace ZIP Signer.

bundledLibrary(path)

SEE NOTE BELOW Adds a dependency on a bundled library JAR file of the current IntelliJ Platform, like lib/annotations.jar

See also:

Java Runtime

Using the jetbrainsRuntime() dependency helper, it is possible to load a custom version of JetBrains Runtime. However, it is recommended to rely on the runtime bundled within the IntelliJ Platform dependency, if present.

Function

Description

jetbrainsRuntime(version, variant, architecture)

jetbrainsRuntime(explicitVersion)

Adds a dependency on JetBrains Runtime.

See the JetBrains Runtime releases page for the list of available releases.

Code Instrumentation

The code instrumentation process handled with the instrumentCode task, requires extra dependencies to work and properly adjust the Java bytecode. There's the instrumentationTools() dependencies helper introduced to apply all required dependencies using default configuration, however, it is possible to add and configure them separately.

Adds a Java Compiler dependency for code instrumentation. The version is determined by the IntelliJ Platform build number. If the exact version is unavailable, the closest one is used, found by scanning all releases.

Function

Description

instrumentationTools()

A helper function to apply all required dependencies: javaCompiler()

javaCompiler()

javaCompiler(version)

Adds a dependency on Java Compiler.

Last modified: 23 April 2024