IntelliJ Platform Plugin SDK Help

Task Awares

The Task Awares is a set of interfaces that can be applied to custom Gradle tasks and, when registered using the dedicated register method, inject new features or properties with predefined values.

IntelliJ Platform Gradle Plugin supports creating custom tasks which can use *Aware interfaces. Example:

import org.jetbrains.intellij.platform.gradle.tasks.aware.PluginAware abstract class RetrievePluginNameTask : DefaultTask(), PluginAware val retrievePluginName by tasks.registering(RetrievePluginNameTask::class) { val outputFile = layout.buildDirectory.file("pluginName.txt") doLast { outputFile.get().asFile.writeText(pluginXml.parse { name }.get()) } }
import org.jetbrains.intellij.platform.gradle.tasks.aware.PluginAware abstract class RetrievePluginNameTask extends DefaultTask implements PluginAware {} tasks.register('retrievePluginName', RetrievePluginNameTask) { def outputFile = layout.buildDirectory.file("pluginName.txt") doLast { outputFile.get().asFile.writeText(pluginXml.parse { name }.get()) } }

AutoReloadAware

Provides the possibility to auto-reload plugin when run in the IDE.

autoReload

Enables auto-reload of dynamic plugins. Dynamic plugin will be reloaded automatically when its content is modified.

This allows a much faster development cycle by avoiding a full restart of the development instance after code changes.

Type

Property<Boolean>

Default value

intellijPlatform.autoReload

CoroutinesJavaAgentAware

Provides the path to the Java Agent file for the Coroutines library required to enable coroutines debugging.

coroutinesJavaAgentFile

The path to the coroutines Java Agent file.

Type

RegularFileProperty

Default value

initializeIntellijPlatformPlugin.coroutinesJavaAgent

IntelliJPlatformVersionAware

Provides a task with the possibility of accessing information about the IntelliJ Platform currently used in the project.

The intelliJPlatformConfiguration input property receives a dependency added to the intellijPlatform configuration, which eventually is resolved and lets to access the IntelliJ Platform details such as ProductInfo or the path to the IntelliJ Platform directory.

It is required to have a dependency on the IntelliJ Platform added to the project with helpers available in Dependencies Extension.

intelliJPlatformConfiguration

Holds the intellijPlatform configuration with the IntelliJ Platform dependency added.

It should not be directly accessed.

Type

ConfigurableFileCollection

platformPath

Provides a direct path to the IntelliJ Platform dependency artifact.

Access

Read-only

Type

Path

productInfo

Provides information about the IntelliJ Platform product.

The information is retrieved from the product-info.json file in the IntelliJ Platform directory.

Access

Read-only

Type

ProductInfo

validateIntelliJPlatformVersion()

Validates that the resolved IntelliJ Platform is supported by checking against the minimal supported IntelliJ Platform version.

Invokes ProductInfo.validateSupportedVersion().

Throws

IllegalArgumentException

JavaCompilerAware

Provides the dependency on Java Compiler required for the code instrumentation to properly configure Ant tasks provided by the IntelliJ Platform.

javaCompilerConfiguration

Holds the intellijPlatformJavaCompiler configuration with the Java Compiler dependency added.

Type

ConfigurableFileCollection

KotlinMetadataAware

An interface that provides access to Kotlin-specific metadata for a Gradle project. The task that inherits from this interface is automatically marked as dependent on the compileKotlin task.

kotlinPluginAvailable

Indicates that the Kotlin Gradle Plugin is loaded and available.

Type

Property<Boolean>

Default value

false

kotlinxCoroutinesLibraryPresent

This variable represents whether the Kotlin Coroutines library is added explicitly to the project dependencies.

Type

Property<Boolean>

Default value

false

kotlinApiVersion

The apiVersion property value of compileKotlin.kotlinOptions defined in the build script.

Type

Property<String?>

Default value

null

kotlinLanguageVersion

The languageVersion property value of compileKotlin.kotlinOptions defined in the build script.

Type

Property<String?>

Default value

null

kotlinVersion

The version of Kotlin used in the project.

Type

Property<String?>

Default value

null

kotlinJvmTarget

The jvmTarget property value of compileKotlin.kotlinOptions defined in the build script.

Type

Property<String?>

Default value

null

kotlinStdlibDefaultDependency

kotlin.stdlib.default.dependency property value defined in the gradle.properties file.

Type

Property<Boolean?>

Default value

null

PluginAware

Provides information about the currently built plugin.

It resolves and parses the final plugin.xml descriptor file, making its details easily accessible.

pluginXml

Holds the path to the patched plugin.xml file.

Type

RegularPropertyFile

Default value

patchPluginXml.outputFile

parse {}

The parse method provides a possibility for parsing the pluginXml file and direct access to the PluginBean object.

Should be used along with the pluginXml property like:

abstract class RetrievePluginNameTask : DefaultTask(), PluginAware val retrievePluginName by tasks.registering(RetrievePluginNameTask::class) { doLast { val name = pluginXml.parse { name }.get() println("Plugin Name: $name") } }
abstract class RetrievePluginNameTask extends DefaultTask implements PluginAware {} tasks.register('retrievePluginName', RetrievePluginNameTask) { doLast { def name = pluginXml.parse { name }.get() println("Plugin Name: $name") } }

PluginVerifierAware

Provides the path to the IntelliJ Plugin Verifier executable.

It is required to have a dependency on the IntelliJ Plugin Verifier added to the project with intellijPlatform.pluginVerifier() dependencies extension.

pluginVerifierExecutable

Path to the IntelliJ Plugin Verifier executable.

Type

RegularFileProperty

RunnableIdeAware

The interface which uses a set of various interfaces required for running a guest IDE. Inherits from:

RuntimeAware

Provides access to the Java Runtime (i.e., JetBrains Runtime) resolved with RuntimeResolver.

runtimeDirectory

Java Runtime parent directory.

Type

DirectoryProperty

runtimeArchitecture

An architecture of the Java Runtime currently used for running Gradle.

Type

Property<String>

runtimeMetadata

Metadata object of the Java Runtime currently used for running Gradle.

Type

Property<String>

runtimeLauncher

A custom JavaLauncher instance configured with the resolved runtimeDirectory.

Type

Property<String>

SandboxAware

Provides quick access to the sandbox container and specific directories located within it.

The path to the sandbox container is obtained using the intellijPlatform.sandboxContainer extension property and the type and version of the IntelliJ Platform applied to the project.

sandboxSuffix

Represents the suffix used i.e., for test-related tasks.

Type

Property<String>

sandboxDirectory

The directory containing content read and produced by the running IDE.

The directory name depends on the platform type and version currently used for running a task.

Type

DirectoryProperty

sandboxConfigDirectory

A configuration directory located within the sandboxDirectory.

Type

DirectoryProperty

sandboxPluginsDirectory

A plugins directory located within the sandboxDirectory.

Type

DirectoryProperty

sandboxSystemDirectory

A system directory located within the sandboxDirectory.

Type

DirectoryProperty

sandboxLogDirectory

A log directory located within the sandboxDirectory.

Type

DirectoryProperty

applySandboxFrom(TaskProvider)

The helper method used for applying sandbox configuration from the sandbox producer (such as prepareSandbox or prepareTestSandbox tasks) to sandbox consumers.

SigningAware

Provides the path to the Marketplace ZIP Signer executable.

It is required to have a dependency on the Marketplace ZIP Signer added to the project with intellijPlatform.zipSigner() dependencies extension.

zipSignerExecutable

Path to the Marketplace ZIP Signer executable.

Type

RegularFileProperty

SplitModeAware

When you develop a plugin, you may want to check how it works in remote development mode, when one machine is running the backend part and another is running a frontend part (JetBrains Client) which connects to the backend.

This property allows running the IDE with backend and frontend parts running in separate processes. The developed plugin is installed in the backend part.

Split Mode requires the IntelliJ Platform in the version 241.14473 or later.

splitMode

Enables Split Mode when running the IDE.

Type

Property<Boolean>

Default value

intellijPlatform.splitMode

splitModeTarget

Specifies in which part of the product the developed plugin should be installed.

Type

Property<SplitModeTarget>

Default value

intellijPlatform.splitModeTarget

TestableAware

Interface used to describe tasks used for running tests, such as testIdeUi, testIdePerformance, or prepareTest used for configuring test and keeping it immutable.

Last modified: 16 August 2024