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.1
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
Target Platforms
Default Target Platforms
See Custom Target Platforms for non-default targets.
Function | Description |
---|---|
| |
| |
| |
| |
| |
| Fleet Backend |
| Gateway |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
|
Custom Target Platforms
Function | Description |
---|---|
| Adds a configurable dependency on the IntelliJ Platform. See Parametrize IntelliJ Platform Dependency. |
| Adds a dependency on a local IntelliJ Platform instance. See Local IntelliJ Platform IDE Instance. |
See also:
Plugins
Function | Description |
---|---|
| Adds a dependency on a bundled IntelliJ Platform plugin. |
| Adds dependencies on bundled IntelliJ Platform plugins. |
| Adds a dependency on a plugin for IntelliJ Platform. |
| Adds a dependency on a plugin for IntelliJ Platform using a string notation:
|
| Adds dependencies on plugins for IntelliJ Platform using a string notation:
|
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:
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 |
---|---|
| Adds a dependency on Test Framework or its variant using |
See also:
Tools
Function | Description |
---|---|
| Adds a dependency on IntelliJ Plugin Verifier. |
| Adds a dependency on Marketplace ZIP Signer. |
| 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 |
---|---|
| 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 |
---|---|
| A helper function to apply all required dependencies: |
| Adds a dependency on Java Compiler. |