[IntelliJ Platform Gradle Plugin] general updates

This commit is contained in:
Jakub Chrzanowski 2024-07-19 16:34:59 +02:00
parent 023b34b220
commit e32887b22a
No known key found for this signature in database
GPG Key ID: C39095BFD769862E
7 changed files with 442 additions and 316 deletions

View File

@ -423,10 +423,10 @@
<toc-element topic="tools_intellij_platform_gradle_plugin.md"> <toc-element topic="tools_intellij_platform_gradle_plugin.md">
<toc-element topic="tools_intellij_platform_gradle_plugin_plugins.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_plugins.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_extension.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_extension.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_testing_extension.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_repositories_extension.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_repositories_extension.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_dependencies_extension.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_dependencies_extension.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_tasks.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_tasks.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_custom_tasks.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_task_awares.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_task_awares.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_types.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_types.md"/>
<toc-element topic="tools_intellij_platform_gradle_plugin_gradle_properties.md"/> <toc-element topic="tools_intellij_platform_gradle_plugin_gradle_properties.md"/>

View File

@ -1,131 +0,0 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# Custom Tasks
<link-summary>IntelliJ Platform Gradle Plugin custom tasks.</link-summary>
<include from="tools_intellij_platform_gradle_plugin.md" element-id="faq"/>
By default, the [](tools_intellij_platform_gradle_plugin_tasks.md#runIde), `test`, [](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi), and [](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance) tasks depend on the IntelliJ Platform defined with [](tools_intellij_platform_gradle_plugin_dependencies_extension.md).
The IntelliJ Platform Gradle Plugin allows also for introducing custom tasks dedicated to running or testing your plugin using a custom IntelliJ Platform.
Registering of a custom task which allows for adjusting the IntelliJ Platform type and version can be done by using one of the below `Custom*Task` classes, depending on the task purpose.
## `CustomRunIdeTask`
{#CustomRunIdeTask}
<tldr>
**Extends**: [`runIde`](tools_intellij_platform_gradle_plugin_tasks.md#runIde), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware)
**Sources**: [`CustomRunIdeTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomRunIdeTask.kt)
</tldr>
Runs the IDE instance using the currently selected IntelliJ Platform with the built plugin loaded.
It directly extends the [`JavaExec`][gradle-javaexec-task] Gradle task, which allows for an extensive configuration (system properties, memory management, etc.).
This task class also inherits from [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware), which makes it possible to create `runIde`-like tasks using custom IntelliJ Platform versions:
```kotlin
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.tasks.CustomRunIdeTask
tasks {
val runPhpStorm by registering(CustomRunIdeTask::class) {
type = IntelliJPlatformType.PhpStorm
version = "2023.2.2"
}
val runWithScalaPlugin by registering(CustomRunIdeTask::class) {
plugins {
plugin("org.intellij.scala", "2023.3.29")
}
}
val runWithoutGitHubPlugin by registering(CustomRunIdeTask::class) {
plugins {
disablePlugin("org.jetbrains.plugins.github")
}
}
val runLocalIde by registering(CustomRunIdeTask::class) {
localPath = file("/Users/user/Applications/Android Studio.app")
}
}
```
## `CustomTestIdeTask`
{#CustomTestIdeTask}
<tldr>
**Extends**: [`test`][gradle-test-task], [`TestableAware`](tools_intellij_platform_gradle_plugin_task_awares.md#TestableAware), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware)
**Sources**: [`CustomTestIdeTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomTestIdeTask.kt)
</tldr>
Runs plugin tests against the currently selected IntelliJ Platform with the built plugin loaded.
It directly extends the [`Test`][gradle-test-task] Gradle task, which allows for an extensive configuration (system properties, memory management, etc.).
This task class also inherits from [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware), which makes it possible to create `runIde`-like tasks using custom IntelliJ Platform versions:
```kotlin
import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType
import org.jetbrains.intellij.platform.gradle.tasks.CustomTestIdeTask
tasks {
val testPhpStorm by registering(CustomTestIdeTask::class) {
type = IntelliJPlatformType.PhpStorm
version = "2023.2.2"
}
val testLocalIde by registering(CustomTestIdeTask::class) {
localPath = file("/Users/hsz/Applications/Android Studio.app")
}
}
```
## `CustomTestIdeUiTask`
{#CustomTestIdeUiTask}
<tldr>
**Extends**: [`testIdeUi`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware)
**Sources**: [`CustomTestIdeUiTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomTestIdeUiTask.kt)
</tldr>
> Not implemented.
>
{style="warning"}
## `CustomTestIdePerformanceTask`
{#CustomTestIdePerformanceTask}
<tldr>
**Extends**: [`testIdePerformance`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware)
**Sources**: [`CustomTestIdePerformanceTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomTestIdePerformanceTask.kt)
</tldr>
> Not implemented.
>
{style="warning"}
<include from="snippets.md" element-id="missingContent"/>
[gradle-javaexec-task]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.JavaExec.html
[gradle-test-task]: https://docs.gradle.org/current/dsl/org.gradle.api.tasks.testing.Test.html

View File

@ -225,7 +225,7 @@ See also:
Configures the plugin definition and stores values in the `plugin.xml` file. Configures the plugin definition and stores values in the `plugin.xml` file.
Data provided to the `intellijPlatform.pluginConfiguration {}` extension is passed to the [`patchPluginXml`](tools_intellij_platform_gradle_plugin_tasks.md#patchPluginXml) task, which augments the <path>plugin.xml</path> file with new values. Data provided to the `intellijPlatform.pluginConfiguration {}` extension is passed to the [`patchPluginXml`](tools_intellij_platform_gradle_plugin_tasks.md#patchPluginXml) task, which augments the <path>plugin.xml</path> file with new values.
Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#build) plugin to be applied. Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#platform) plugin to be applied.
**Example:** **Example:**
@ -592,7 +592,7 @@ See also:
Configures the publishing process of the plugin. Configures the publishing process of the plugin.
All values are passed to the [](tools_intellij_platform_gradle_plugin_tasks.md#publishPlugin) task. All values are passed to the [](tools_intellij_platform_gradle_plugin_tasks.md#publishPlugin) task.
Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#publish) plugin to be applied. Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#platform) plugin to be applied.
**Example:** **Example:**
@ -697,7 +697,7 @@ See also:
Plugin signing configuration. Plugin signing configuration.
Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#publish) plugin to be applied. Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#platform) plugin to be applied.
**Example:** **Example:**
@ -892,7 +892,7 @@ See also:
IntelliJ Plugin Verifier CLI tool configuration. IntelliJ Plugin Verifier CLI tool configuration.
Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#verify) plugin to be applied. Requires the [](tools_intellij_platform_gradle_plugin_plugins.md#platform) plugin to be applied.
**Example:** **Example:**

View File

@ -121,7 +121,7 @@ dependencies {
} }
``` ```
Note that the `:submodule` is added both to the `implementation` configuration and `intellijPlatformPluginModule` using the `pluginModule` helper method. Note that the `:submodule` is added both to the `implementation` configuration and `intellijPlatformPluginModule` using the [](tools_intellij_platform_gradle_plugin_dependencies_extension.md#plugins) helper method.
This guarantees that the submodule content will be merged into the main plugin Jar file. This guarantees that the submodule content will be merged into the main plugin Jar file.

View File

@ -80,101 +80,13 @@ Default value
: [`initializeIntellijPlatformPlugin.coroutinesJavaAgent`](tools_intellij_platform_gradle_plugin_tasks.md#initializeIntelliJPlatformPlugin-coroutinesJavaAgent) : [`initializeIntellijPlatformPlugin.coroutinesJavaAgent`](tools_intellij_platform_gradle_plugin_tasks.md#initializeIntelliJPlatformPlugin-coroutinesJavaAgent)
## `CustomIntelliJPlatformVersionAware`
{#CustomIntelliJPlatformVersionAware}
<tldr>
**Depends on**: [`IntelliJPlatformVersionAware`](#IntelliJPlatformVersionAware)
**Inherited by**: [`CustomRunIdeTask`](tools_intellij_platform_gradle_plugin_custom_tasks.md#CustomRunIdeTask), [`CustomTestIdePerformanceTask`](tools_intellij_platform_gradle_plugin_custom_tasks.md#CustomTestIdePerformanceTask), [`CustomTestIdeTask`](tools_intellij_platform_gradle_plugin_custom_tasks.md#CustomTestIdeTask), [`CustomTestIdeUiTask`](tools_intellij_platform_gradle_plugin_custom_tasks.md#CustomTestIdeUiTask)
**Sources**: [`CustomIntelliJPlatformVersionAware`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/CustomIntelliJPlatformVersionAware.kt)
</tldr>
By default, the project with the IntelliJ Platform Gradle Plugin applied required the presence of the IntelliJ Platform, referred to later by various tasks, configurations, and extensions.
The custom IntelliJ Platform concept allows using another version, i.e., to run a guest IDE or tests against it.
When applying this interface to the task, custom configurations to hold new dependencies defined by [`type`](#CustomIntelliJPlatformVersionAware-type) and [`version`](#CustomIntelliJPlatformVersionAware-version) (or [`localPath`](#CustomIntelliJPlatformVersionAware-localPath), if referring to the local IntelliJ Platform instance) are created, as well as a dedicated [`prepareSandbox`](tools_intellij_platform_gradle_plugin_tasks.md#prepareSandbox) task.
Configurations, as well as the task preparing sandbox for running and testing the custom IntelliJ Platform (if required), have a random suffix applied to avoid collisions.
### `type`
{#CustomIntelliJPlatformVersionAware-type}
An input property to configure the type of the custom IntelliJ Platform.
By default, it refers to the IntelliJ Platform type used by the current project.
{style="narrow"}
Type
: [`IntelliJPlatformType`](tools_intellij_platform_gradle_plugin_types.md#IntelliJPlatformType)
### `version`
{#CustomIntelliJPlatformVersionAware-version}
An input property to configure the version of the custom IntelliJ Platform.
By default, it refers to the IntelliJ Platform version used by the current project.
{style="narrow"}
Type
: `Property<String>`
### `localPath`
{#CustomIntelliJPlatformVersionAware-localPath}
An input property to define the path to the local IntelliJ Platform instance to configure the version of the custom IntelliJ Platform.
The local path precedes the IntelliJ Platform resolution using the [`type`](#CustomIntelliJPlatformVersionAware-type) and [`version`](#CustomIntelliJPlatformVersionAware-version) properties.
{style="narrow"}
Type
: `DirectoryProperty`
### `plugins {}`
{#CustomIntelliJPlatformVersionAware-plugins}
An extension to provide custom plugins to be added when running the task enhanced with `CustomIntelliJPlatformVersionAware`.
It provides several methods for adding remote and local plugins, or for disabling already loaded or bundled plugin.
**Example:**
```kotlin
tasks {
val runIdeWithPlugins by registering(CustomRunIdeTask::class) {
// ...
plugins {
plugin("pluginId", "1.0.0")
disablePlugin("pluginId")
}
}
}
```
| Function | Description |
|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `plugin(id, version, channel)` | Adds a dependency on a plugin for a custom IntelliJ Platform. |
| `plugin(notation)` | Adds a dependency on a plugin for a custom IntelliJ Platform using a string notation:<p>`pluginId:version` or `pluginId:version@channel`</p> |
| `plugins(notations)` | Adds dependencies on plugins for a custom IntelliJ Platform using a string notation:<p>`pluginId:version` or `pluginId:version@channel`</p> |
| `disablePlugin(id)` | Disables the specific plugin with its ID. |
| `disablePlugins(ids)` | Disables specific plugins with the list of their IDs. |
| `localPlugin(path)` | Adds a dependency on a local IntelliJ Platform plugin. Accepts path or a dependency on another module. |
## `IntelliJPlatformVersionAware` ## `IntelliJPlatformVersionAware`
{#IntelliJPlatformVersionAware} {#IntelliJPlatformVersionAware}
<tldr> <tldr>
**Inherited by**: [`CustomIntelliJPlatformVersionAware`](#CustomIntelliJPlatformVersionAware), [`RuntimeAware`](#RuntimeAware), [`SandboxAware`](#SandboxAware), [`SplitModeAware`](#SplitModeAware), [`initializeIntelliJPlatformPlugin`](tools_intellij_platform_gradle_plugin_tasks.md#initializeIntelliJPlatformPlugin), [`patchPluginXml`](tools_intellij_platform_gradle_plugin_tasks.md#patchPluginXml), [`printBundledPlugins`](tools_intellij_platform_gradle_plugin_tasks.md#printBundledPlugins), [`runIde`](tools_intellij_platform_gradle_plugin_tasks.md#runIde), [`testIdePerformance`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance), [`testIdeUi`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi), [`verifyPluginProjectConfiguration`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPluginProjectConfiguration) **Inherited by**: [`RuntimeAware`](#RuntimeAware), [`SandboxAware`](#SandboxAware), [`SplitModeAware`](#SplitModeAware), [`initializeIntelliJPlatformPlugin`](tools_intellij_platform_gradle_plugin_tasks.md#initializeIntelliJPlatformPlugin), [`patchPluginXml`](tools_intellij_platform_gradle_plugin_tasks.md#patchPluginXml), [`printBundledPlugins`](tools_intellij_platform_gradle_plugin_tasks.md#printBundledPlugins), [`runIde`](tools_intellij_platform_gradle_plugin_tasks.md#runIde), [`testIdePerformance`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance), [`testIdeUi`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi), [`verifyPluginProjectConfiguration`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPluginProjectConfiguration)
**Sources**: [`IntelliJPlatformVersionAware`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/IntelliJPlatformVersionAware.kt) **Sources**: [`IntelliJPlatformVersionAware`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/IntelliJPlatformVersionAware.kt)
@ -431,8 +343,6 @@ Provides quick access to the sandbox container and specific directories located
The path to the sandbox container is obtained using the [`intellijPlatform.sandboxContainer`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-sandboxContainer) extension property and the type and version of the IntelliJ Platform applied to the project. The path to the sandbox container is obtained using the [`intellijPlatform.sandboxContainer`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-sandboxContainer) extension property and the type and version of the IntelliJ Platform applied to the project.
Paths respect custom IntelliJ Platform when combined with [`CustomIntelliJPlatformVersionAware`](#CustomIntelliJPlatformVersionAware).
### `sandboxSuffix` ### `sandboxSuffix`
{#SandboxAware-sandboxSuffix} {#SandboxAware-sandboxSuffix}
@ -588,13 +498,13 @@ Default value
<tldr> <tldr>
**Inherited by**: [`prepareTest`](tools_intellij_platform_gradle_plugin_tasks.md#prepareTest), [`CustomTestIdeTask`](tools_intellij_platform_gradle_plugin_custom_tasks.md#CustomTestIdeTask) **Inherited by**: [`prepareTest`](tools_intellij_platform_gradle_plugin_tasks.md#prepareTest)
**Sources**: [`TestableAware`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/TestableAware.kt) **Sources**: [`TestableAware`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/TestableAware.kt)
</tldr> </tldr>
Interface used to describe tasks used for running tests, such as a customizable [`CustomTestIdeTask`](tools_intellij_platform_gradle_plugin_custom_tasks.md#CustomTestIdeTask) or [`prepareTest`](tools_intellij_platform_gradle_plugin_tasks.md#prepareTest) used for configuring `test` and keeping it immutable. Interface used to describe tasks used for running tests, such as [`testIdeUi`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi), [`testIdePerformance`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance), or [`prepareTest`](tools_intellij_platform_gradle_plugin_tasks.md#prepareTest) used for configuring `test` and keeping it immutable.
<include from="snippets.md" element-id="missingContent"/> <include from="snippets.md" element-id="missingContent"/>

View File

@ -42,21 +42,16 @@ flowchart LR
end end
end end
subgraph RUN ["Run"]
runIde
end
subgraph PUBLISH ["Publish"] subgraph PUBLISH ["Publish"]
publishPlugin publishPlugin
signPlugin signPlugin
end end
subgraph TEST ["Test"] subgraph TEST ["Test"]
runIde
prepareTest prepareTest
testIdePerformance>testIdePerformance] testIdePerformance>testIdePerformance]
testIdeUi>testIdeUi] testIdeUi>testIdeUi]
end end
subgraph VERIFY ["Verify"] subgraph VERIFY ["Verify"]
@ -142,6 +137,8 @@ flowchart LR
style ALL fill:transparent style ALL fill:transparent
``` ```
## `buildPlugin` ## `buildPlugin`
{#buildPlugin} {#buildPlugin}
@ -168,6 +165,7 @@ By default, the `archiveBaseName` is set to the plugin name specified in the <pa
> >
{style="warning"} {style="warning"}
### `archiveFile` ### `archiveFile`
{#buildPlugin-archiveFile} {#buildPlugin-archiveFile}
@ -177,8 +175,6 @@ Specifies the archive file representing the output file produced by the task.
Type Type
: `RegularFileProperty` : `RegularFileProperty`
Default value
: [`buildPlugin.archiveFile`](#buildPlugin-archiveFile)
## `buildSearchableOptions` ## `buildSearchableOptions`
@ -186,7 +182,7 @@ Default value
<tldr> <tldr>
**Depends on**: [`patchPluginXml`](#patchPluginXml), [`prepareSandbox`](#prepareSandbox) **Depends on**: [`prepareSandbox`](#prepareSandbox)
**Extends**: [`JavaExec`][gradle-javaexec-task], [`RunnableIdeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RunnableIdeAware) **Extends**: [`JavaExec`][gradle-javaexec-task], [`RunnableIdeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RunnableIdeAware)
@ -197,10 +193,10 @@ Default value
Builds the index of UI components (searchable options) for the plugin. Builds the index of UI components (searchable options) for the plugin.
This task runs a headless IDE instance to collect all the available options provided by the plugin's [](settings.md). This task runs a headless IDE instance to collect all the available options provided by the plugin's [](settings.md).
If the plugin doesn't implement custom settings, it is recommended to disable this task via [`intellijPlatform.buildSearchableOptions`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-buildSearchableOptions) build feature. If the plugin doesn't implement custom settings, it is recommended to disable this task via [`intellijPlatform.buildSearchableOptions`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-buildSearchableOptions) flag.
In the case of running the task for the plugin using [`intellijPlatform.pluginConfiguration.productDescriptor`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor), a warning will be logged regarding potential issues with running headless IDE for paid plugins. In the case of running the task for the plugin that has [`intellijPlatform.pluginConfiguration.productDescriptor`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor) defined, a warning will be logged regarding potential issues with running headless IDE for paid plugins.
It is possible to mute this warning with the [`paidPluginSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#paidPluginSearchableOptionsWarning) build feature. It is possible to mute this warning with the [`paidPluginSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#paidPluginSearchableOptionsWarning) Gradle property.
### `outputDirectory` ### `outputDirectory`
@ -230,6 +226,104 @@ Default value
: [`paidPluginSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#paidPluginSearchableOptionsWarning) && `productDescriptor` is defined : [`paidPluginSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#paidPluginSearchableOptionsWarning) && `productDescriptor` is defined
## `composedJar`
{#composedJar}
<tldr>
**Extends**: [`Jar`][gradle-jar-task], [`instrumentedJar`](#instrumentedJar)
**Sources**: [`ComposedJarTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/ComposedJarTask.kt)
</tldr>
Composes a final Jar archive by combining the output of base `jar` or [`instrumentedJar`](#instrumentedJar) tasks,
depending on if code instrumentation is enabled with [`intellijPlatform.instrumentCode`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-instrumentCode).
The final Jar is also combined with plugin modules marked using the [`pluginModule`](tools_intellij_platform_gradle_plugin_dependencies_extension.md#plugins) dependencies helper.
### `archiveFile`
{#composedJar-archiveFile}
Specifies the archive file representing the output file produced by the task.
{style="narrow"}
Type
: `RegularFileProperty`
## `generateManifest`
{#generateManifest}
<tldr>
**Extends**: [`DefaultTask`][gradle-default-task], [`IntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#IntelliJPlatformVersionAware)
**Sources**: [`InitializeIntelliJPlatformPluginTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/InitializeIntelliJPlatformPluginTask.kt)
</tldr>
Generates the <path>MANIFEST.MF</path> file with all relevant information about the project configuration.
To apply the produced manifest file, `JarCompanion.applyPluginManifest` method should be called on a task extending [`Jar`][gradle-jar-task].
This file is bundled into the output jar files produced by [`composedJar`](#composedJar), [`instrumentedJar`](#instrumentedJar), and [`Jar`][gradle-jar-task] tasks.
### `pluginVersion`
{#generateManifest-pluginVersion}
The IntelliJ Platform Gradle Plugin version.
{style="narrow"}
Type
: `Property<String>`
### `gradleVersion`
{#generateManifest-gradleVersion}
The version of currently used Gradle.
{style="narrow"}
Type
: `Property<String>`
### `productInfo`
{#generateManifest-productInfo}
The [ProductInfo] instance of the current IntelliJ Platform.
{style="narrow"}
Type
: `Property<ProductInfo>`
### `version`
{#generateManifest-version}
Plugin version.
{style="narrow"}
Type
: `Property<String>`
### `generatedManifest`
{#generateManifest-generatedManifest}
Location of the generated <path>MANIFEST.MF</path> file.
{style="narrow"}
Type
: `RegularFileProperty`
## `initializeIntelliJPlatformPlugin` ## `initializeIntelliJPlatformPlugin`
{#initializeIntelliJPlatformPlugin} {#initializeIntelliJPlatformPlugin}
@ -247,14 +341,14 @@ It is responsible for:
- checking if the project uses IntelliJ Platform Gradle Plugin in the latest available version - checking if the project uses IntelliJ Platform Gradle Plugin in the latest available version
- preparing the KotlinX Coroutines Java Agent file to enable coroutines debugging when developing the plugin - preparing the KotlinX Coroutines Java Agent file to enable coroutines debugging when developing the plugin
The self-update check can be disabled via [`selfUpdateCheck`](tools_intellij_platform_gradle_plugin_gradle_properties.md#selfUpdateCheck) build feature. The self-update check can be disabled via [`selfUpdateCheck`](tools_intellij_platform_gradle_plugin_gradle_properties.md#selfUpdateCheck) Gradle property.
To make the Coroutines Java Agent available for the task, inherit from [`CoroutinesJavaAgentAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CoroutinesJavaAgentAware). To make the Coroutines Java Agent available for the task, inherit from [`CoroutinesJavaAgentAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CoroutinesJavaAgentAware).
### `offline` ### `offline`
{#initializeIntelliJPlatformPlugin-offline} {#initializeIntelliJPlatformPlugin-offline}
Determines if the operation is running in offline mode, and depends on Gradle start parameters. Determines if the operation is running in offline mode and depends on Gradle start parameters.
{style="narrow"} {style="narrow"}
Type Type
@ -315,6 +409,27 @@ Type
: `Property<String>` : `Property<String>`
### `latestPluginVersion`
{#initializeIntelliJPlatformPlugin-latestPluginVersion}
Represents the latest version of the plugin.
{style="narrow"}
Type
: `Property<String>`
### `module`
{#initializeIntelliJPlatformPlugin-module}
Defines that the current project has only the [](tools_intellij_platform_gradle_plugin_plugins.md#module) applied but no [](tools_intellij_platform_gradle_plugin_plugins.md#platform).
{style="narrow"}
Type
: `Property<String>`
## `instrumentCode` ## `instrumentCode`
{#instrumentCode} {#instrumentCode}
@ -372,6 +487,7 @@ Type
Default value: Default value:
: `.form` files of the project's source sets. : `.form` files of the project's source sets.
### `sourceDirs` ### `sourceDirs`
{#instrumentCode-sourceDirs} {#instrumentCode-sourceDirs}
@ -405,6 +521,7 @@ Type
: `DirectoryProperty` : `DirectoryProperty`
## `instrumentedJar` ## `instrumentedJar`
{#instrumentedJar} {#instrumentedJar}
@ -416,7 +533,8 @@ Type
</tldr> </tldr>
Creates a duplicate of the current module's `jar` file with instrumented classes added. Creates a copy of the current module's `jar` task output with instrumented classes added.
## `jarSearchableOptions` ## `jarSearchableOptions`
@ -465,7 +583,7 @@ Default value
{#jarSearchableOptions-noSearchableOptionsWarning} {#jarSearchableOptions-noSearchableOptionsWarning}
Specifies if a warning is emitted when no searchable options are found. Specifies if a warning is emitted when no searchable options are found.
Can be disabled with [`noSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#noSearchableOptionsWarning) build feature. Can be disabled with [`noSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#noSearchableOptionsWarning) Gradle property.
{style="narrow"} {style="narrow"}
Type Type
@ -475,6 +593,7 @@ Default value
: [`noSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#noSearchableOptionsWarning) : [`noSearchableOptionsWarning`](tools_intellij_platform_gradle_plugin_gradle_properties.md#noSearchableOptionsWarning)
## `patchPluginXml` ## `patchPluginXml`
{#patchPluginXml} {#patchPluginXml}
@ -486,6 +605,8 @@ Default value
</tldr> </tldr>
Patches <path>plugin.xml</path> files with values provided with the [`intelliJPlatform.pluginConfiguration`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration) extension.
### `inputFile` ### `inputFile`
{#patchPluginXml-inputFile} {#patchPluginXml-inputFile}
@ -549,8 +670,8 @@ Default value
### `pluginVersion` ### `pluginVersion`
{#patchPluginXml-pluginVersion} {#patchPluginXml-pluginVersion}
Specifies the plugin version displayed in the <control>Plugins</control> settings dialog and on the JetBrains Marketplace plugin page. Specifies the plugin version displayed in the <control>Plugins</control> settings dialog and on the [JetBrains Marketplace](https://plugins.jetbrains.com) plugin page.
Plugins uploaded to the JetBrains Marketplace must follow [semantic versioning](https://plugins.jetbrains.com/docs/marketplace/semver.htm). Plugins uploaded to [JetBrains Marketplace](https://plugins.jetbrains.com) must follow [semantic versioning](https://plugins.jetbrains.com/docs/marketplace/semver.htm).
The provided value will be assigned to the [`<version>`](plugin_configuration_file.md#idea-plugin__version) element. The provided value will be assigned to the [`<version>`](plugin_configuration_file.md#idea-plugin__version) element.
{style="narrow"} {style="narrow"}
@ -564,7 +685,7 @@ Default value
### `pluginDescription` ### `pluginDescription`
{#patchPluginXml-pluginDescription} {#patchPluginXml-pluginDescription}
Specifies the plugin description displayed in the <control>Plugins</control> settings dialog and on the JetBrains Marketplace plugin page. Specifies the plugin description displayed in the <control>Plugins</control> settings dialog and on the [JetBrains Marketplace](https://plugins.jetbrains.com) plugin page.
Simple HTML elements, like text formatting, paragraphs, lists, etc., are allowed. Simple HTML elements, like text formatting, paragraphs, lists, etc., are allowed.
The description content is automatically wrapped in `<![CDATA[... ]]>`. The description content is automatically wrapped in `<![CDATA[... ]]>`.
The provided value will be assigned to the [`<description>`](plugin_configuration_file.md#idea-plugin__description) element. The provided value will be assigned to the [`<description>`](plugin_configuration_file.md#idea-plugin__description) element.
@ -581,12 +702,14 @@ Default value
{#patchPluginXml-changeNotes} {#patchPluginXml-changeNotes}
A short summary of new features, bugfixes, and changes provided in this plugin version. A short summary of new features, bugfixes, and changes provided in this plugin version.
Change notes are displayed on the JetBrains Marketplace plugin page and in the <control>Plugins</control> settings dialog. Change notes are displayed on the [JetBrains Marketplace](https://plugins.jetbrains.com) plugin page and in the <control>Plugins</control> settings dialog.
Simple HTML elements, like text formatting, paragraphs, lists, etc., are allowed. Simple HTML elements, like text formatting, paragraphs, lists, etc., are allowed.
The change notes content is automatically wrapped in `<![CDATA[... ]]>`. The change notes content is automatically wrapped in `<![CDATA[... ]]>`.
The provided value will be assigned to the [`<change-notes>`](plugin_configuration_file.md#idea-plugin__change-notes) element. The provided value will be assigned to the [`<change-notes>`](plugin_configuration_file.md#idea-plugin__change-notes) element.
To maintain and generate an up-to-date changelog, try using [Gradle Changelog Plugin](https://github.com/JetBrains/gradle-changelog-plugin).
{style="narrow"} {style="narrow"}
Type Type
: `Property<String>` : `Property<String>`
@ -600,7 +723,7 @@ Default value
The plugin product code used in the JetBrains Sales System. The plugin product code used in the JetBrains Sales System.
The code must be agreed with JetBrains in advance and follow [the requirements](https://plugins.jetbrains.com/docs/marketplace/obtain-a-product-code-from-jetbrains.html). The code must be agreed with JetBrains in advance and follow [the requirements](https://plugins.jetbrains.com/docs/marketplace/obtain-a-product-code-from-jetbrains.html).
The provided value will be assigned to the `<product-descriptor code="">` element attribute. The provided value will be assigned to the [`<product-descriptor code="">`](plugin_configuration_file.md#idea-plugin__product-descriptor) element attribute.
{style="narrow"} {style="narrow"}
Type Type
@ -609,15 +732,12 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.productDescriptor.code`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-code) : [`intellijPlatform.pluginConfiguration.productDescriptor.code`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-code)
See also:
- [Plugin Configuration File: `product-descriptor`](plugin_configuration_file.md#idea-plugin__product-descriptor)
### `productDescriptorReleaseDate` ### `productDescriptorReleaseDate`
{#patchPluginXml-productDescriptorReleaseDate} {#patchPluginXml-productDescriptorReleaseDate}
Date of the major version release in the `YYYYMMDD` format. Date of the major version release in the `YYYYMMDD` format.
The provided value will be assigned to the `<product-descriptor release-date="">` element attribute. The provided value will be assigned to the [`<product-descriptor release-date="">`](plugin_configuration_file.md#idea-plugin__product-descriptor) element attribute.
{style="narrow"} {style="narrow"}
Type Type
@ -626,16 +746,12 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.productDescriptor.releaseDate`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-releaseDate) : [`intellijPlatform.pluginConfiguration.productDescriptor.releaseDate`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-releaseDate)
See also:
- [Plugin Configuration File: `product-descriptor`](plugin_configuration_file.md#idea-plugin__product-descriptor)
### `productDescriptorReleaseVersion` ### `productDescriptorReleaseVersion`
{#patchPluginXml-productDescriptorReleaseVersion} {#patchPluginXml-productDescriptorReleaseVersion}
Specifies the major version of the plugin in a special number format used for paid plugins on the Specifies the major version of the plugin in a special number format used for paid plugins on [JetBrains Marketplace](https://plugins.jetbrains.com/docs/marketplace/add-required-parameters.html).
[JetBrains Marketplace](https://plugins.jetbrains.com/docs/marketplace/add-required-parameters.html) The provided value will be assigned to the [`<product-descriptor release-version="">`](plugin_configuration_file.md#idea-plugin__product-descriptor) element attribute.
The provided value will be assigned to the `<product-descriptor release-version="">` element attribute.
{style="narrow"} {style="narrow"}
Type Type
@ -644,15 +760,12 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.productDescriptor.releaseVersion`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-releaseVersion) : [`intellijPlatform.pluginConfiguration.productDescriptor.releaseVersion`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-releaseVersion)
See also:
- [Plugin Configuration File: `product-descriptor`](plugin_configuration_file.md#idea-plugin__product-descriptor)
### `productDescriptorOptional` ### `productDescriptorOptional`
{#patchPluginXml-productDescriptorOptional} {#patchPluginXml-productDescriptorOptional}
Specifies the boolean value determining whether the plugin is a [Freemium](https://plugins.jetbrains.com/docs/marketplace/freemium.html) plugin. Specifies the boolean value determining whether the plugin is a [Freemium](https://plugins.jetbrains.com/docs/marketplace/freemium.html) plugin.
The provided value will be assigned to the `<product-descriptor optional="">` element attribute. The provided value will be assigned to the [`<product-descriptor optional="">`](plugin_configuration_file.md#idea-plugin__product-descriptor) element attribute.
{style="narrow"} {style="narrow"}
Type Type
@ -661,18 +774,12 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.productDescriptor.optional`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-optional) : [`intellijPlatform.pluginConfiguration.productDescriptor.optional`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-productDescriptor-optional)
Default value
: `false`
See also:
- [Plugin Configuration File: `product-descriptor`](plugin_configuration_file.md#idea-plugin__product-descriptor)
### `sinceBuild` ### `sinceBuild`
{#patchPluginXml-sinceBuild} {#patchPluginXml-sinceBuild}
Specifies the lowest IDE version compatible with the plugin. Specifies the lowest IDE version compatible with the plugin.
The provided value will be assigned to the `<idea-version since-build="..."/>` element attribute. The provided value will be assigned to the [`<idea-version since-build="..."/>`](plugin_configuration_file.md#idea-plugin__idea-version) element attribute.
{style="narrow"} {style="narrow"}
Type Type
@ -681,9 +788,6 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.ideaVersion.sinceBuild`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-ideaVersion-sinceBuild) : [`intellijPlatform.pluginConfiguration.ideaVersion.sinceBuild`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-ideaVersion-sinceBuild)
See also:
- [Plugin Configuration File: `idea-version`](plugin_configuration_file.md#idea-plugin__idea-version)
### `untilBuild` ### `untilBuild`
{#patchPluginXml-untilBuild} {#patchPluginXml-untilBuild}
@ -692,7 +796,13 @@ The highest IDE version compatible with the plugin.
The `until-build` attribute can be unset by setting `provider { null }` as a value, and note that only passing `null` will make Gradle use the default value instead. The `until-build` attribute can be unset by setting `provider { null }` as a value, and note that only passing `null` will make Gradle use the default value instead.
However, if `until-build` is undefined, compatibility with all the IDEs since the version specified by the `since-build` is assumed, which can cause incompatibility errors in future builds. However, if `until-build` is undefined, compatibility with all the IDEs since the version specified by the `since-build` is assumed, which can cause incompatibility errors in future builds.
The provided value will be assigned to the `<idea-version until-build="..."/>` element attribute. The provided value will be assigned to the [`<idea-version until-build="..."/>`](plugin_configuration_file.md#idea-plugin__idea-version) element attribute.
The `until-build` attribute can be unset by setting `provider { null }` as a value.
> Passing `null` will make Gradle use the default value instead.
>
{style="warning"}
{style="narrow"} {style="narrow"}
Type Type
@ -701,14 +811,11 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.ideaVersion.untilBuild`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-ideaVersion-untilBuild) : [`intellijPlatform.pluginConfiguration.ideaVersion.untilBuild`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-ideaVersion-untilBuild)
See also:
- [Plugin Configuration File: `idea-version`](plugin_configuration_file.md#idea-plugin__idea-version)
### `vendorName` ### `vendorName`
{#patchPluginXml-vendorName} {#patchPluginXml-vendorName}
Specifies the vendor name or organization ID (if created) in the <control>Plugins</control> settings dialog and on the JetBrains Marketplace plugin page. Specifies the vendor name or organization ID (if created) in the <control>Plugins</control> settings dialog and on the [JetBrains Marketplace](https://plugins.jetbrains.com) plugin page.
The provided value will be assigned to the [`<vendor>`](plugin_configuration_file.md#idea-plugin__vendor) element. The provided value will be assigned to the [`<vendor>`](plugin_configuration_file.md#idea-plugin__vendor) element.
{style="narrow"} {style="narrow"}
@ -723,7 +830,7 @@ Default value
{#patchPluginXml-vendorEmail} {#patchPluginXml-vendorEmail}
Specifies the vendor's email address. Specifies the vendor's email address.
The provided value will be assigned to the `<vendor email="">` element attribute. The provided value will be assigned to the [`<vendor email="">`](plugin_configuration_file.md#idea-plugin__vendor) element attribute.
{style="narrow"} {style="narrow"}
Type Type
@ -732,15 +839,12 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.vendor.email`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-vendor-email) : [`intellijPlatform.pluginConfiguration.vendor.email`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-vendor-email)
See also:
- [Plugin Configuration File: `vendor`](plugin_configuration_file.md#idea-plugin__vendor)
### `vendorUrl` ### `vendorUrl`
{#patchPluginXml-vendorUrl} {#patchPluginXml-vendorUrl}
Specifies the link to the vendor's homepage. Specifies the link to the vendor's homepage.
The provided value will be assigned to the `<vendor url="">` element attribute. The provided value will be assigned to the [`<vendor url="">`](plugin_configuration_file.md#idea-plugin__vendor) element attribute.
{style="narrow"} {style="narrow"}
Type Type
@ -749,8 +853,6 @@ Type
Default value Default value
: [`intellijPlatform.pluginConfiguration.vendor.url`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-vendor-url) : [`intellijPlatform.pluginConfiguration.vendor.url`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-vendor-url)
See also:
- [Plugin Configuration File: `vendor`](plugin_configuration_file.md#idea-plugin__vendor)
## `prepareSandbox` ## `prepareSandbox`
@ -767,13 +869,26 @@ See also:
</tldr> </tldr>
Prepares a sandbox environment with the plugin and its dependencies installed. Prepares a sandbox environment with the plugin and its dependencies installed.
The sandbox directory is required by tasks that run IDE and tests in isolation from other instances, The sandbox directory is required by tasks that run IDE and tests in isolation from other instances, like when multiple IntelliJ Platforms are used for testing with [`runIde`](#runIde), [`prepareTest`](#prepareTest), [`testIdeUi`](#testIdeUi), or [`testIdePerformance`](#testIdePerformance) tasks.
like when multiple IntelliJ Platforms are used for testing with [`runIde`](#runIde), [`prepareTest`](#prepareTest), [`testIdeUi`](#testIdeUi), or [`testIdePerformance`](#testIdePerformance) tasks. The sandbox directory is created within the container configurable with [`intellijPlatform.sandboxContainer`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-sandboxContainer).
To fully use the sandbox capabilities in a task, extend from [`SandboxAware`](tools_intellij_platform_gradle_plugin_task_awares.md#SandboxAware). Tasks based on the [`PrepareSandboxTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt) are _sandbox producers_ and can be associated with _sandbox consumers_.
To define the consumer task, make it extend from [`SandboxAware`](tools_intellij_platform_gradle_plugin_task_awares.md#SandboxAware) and apply the `consumer.applySandboxFrom(producer)` function.
See also:
- [Extension: `intellijPlatform.sandboxContainer`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-sandboxContainer) ### `sandboxSuffix`
{#prepareSandbox-sandboxSuffix}
Represents the suffix used i.e., for test-related or custom tasks.
The default suffix is composed of the task name (`prepare[X]Sandbox[_Y]`) to the `-[X][Y]` format.
{style="narrow"}
Type
: `Property<String>`
Default value
: [`SandboxAware.sandboxPluginsDirectory`](tools_intellij_platform_gradle_plugin_task_awares.md#SandboxAware-sandboxPluginsDirectory)
### `defaultDestinationDirectory` ### `defaultDestinationDirectory`
@ -789,11 +904,24 @@ Default value
: [`SandboxAware.sandboxPluginsDirectory`](tools_intellij_platform_gradle_plugin_task_awares.md#SandboxAware-sandboxPluginsDirectory) : [`SandboxAware.sandboxPluginsDirectory`](tools_intellij_platform_gradle_plugin_task_awares.md#SandboxAware-sandboxPluginsDirectory)
### `pluginDirectory`
{#prepareSandbox-pluginDirectory}
Specifies the directory where the plugin artifacts are to be placed.
{style="narrow"}
Type
: `DirectoryProperty`
Default value
: [`defaultDestinationDirectory`](#prepareSandbox-defaultDestinationDirectory)/[`intellijPlatform.projectName`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-projectName)
### `disabledPlugins` ### `disabledPlugins`
{#prepareSandbox-disabledPlugins} {#prepareSandbox-disabledPlugins}
An internal field to hold a list of plugins to be disabled within the current sandbox. An internal field to hold a list of plugins to be disabled within the current sandbox.
This property is controlled with [`disablePlugin()`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware-plugins) method of [](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware). This property is controlled with [`disablePlugin()`](tools_intellij_platform_gradle_plugin_testing_extension.md#plugins) method of [](tools_intellij_platform_gradle_plugin_testing_extension.md).
{style="narrow"} {style="narrow"}
Type Type
@ -803,7 +931,7 @@ Type
### `pluginJar` ### `pluginJar`
{#prepareSandbox-pluginJar} {#prepareSandbox-pluginJar}
Specifies the output of the `Jar` task. Specifies the output of the [`Jar`][gradle-jar-task] task.
The proper `Jar.archiveFile` picked depends on whether code instrumentation is enabled. The proper `Jar.archiveFile` picked depends on whether code instrumentation is enabled.
{style="narrow"} {style="narrow"}
@ -813,22 +941,16 @@ Type
Default value Default value
: `Jar.archiveFile` : `Jar.archiveFile`
See also:
- [Extension: `intellijPlatform.instrumentCode`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-instrumentCode)
### `pluginsClasspath` ### `pluginsClasspath`
{#prepareSandbox-pluginsClasspath} {#prepareSandbox-pluginsClasspath}
Specifies a list of dependencies on external plugins resolved from the `intellijPlatformPluginsExtracted` configuration. Specifies a list of dependencies on external plugins resolved from the `intellijPlatformPluginsExtracted` configuration added with [Dependencies Extension](tools_intellij_platform_gradle_plugin_dependencies_extension.md#plugins)
{style="narrow"} {style="narrow"}
Type Type
: `ConfigurableFileCollection` : `ConfigurableFileCollection`
See also:
- [Dependencies Extension](tools_intellij_platform_gradle_plugin_dependencies_extension.md)
### `runtimeClasspath` ### `runtimeClasspath`
{#prepareSandbox-runtimeClasspath} {#prepareSandbox-runtimeClasspath}
@ -840,18 +962,39 @@ Type
: `ConfigurableFileCollection` : `ConfigurableFileCollection`
## `prepareTest` ## `prepareTest`
{#prepareTest} {#prepareTest}
<tldr> <tldr>
**Depends on**: [`prepareTestSandbox`](#prepareTestSandbox)
**Extends**: [`DefaultTask`][gradle-default-task], [`TestableAware`](tools_intellij_platform_gradle_plugin_task_awares.md#TestableAware) **Extends**: [`DefaultTask`][gradle-default-task], [`TestableAware`](tools_intellij_platform_gradle_plugin_task_awares.md#TestableAware)
**Sources**: [`PrepareTestTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareTestTask.kt) **Sources**: [`PrepareTestTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareTestTask.kt)
</tldr> </tldr>
Prepares an immutable `test` task and provides all necessary dependencies and configurations for a proper testing configuration. Prepares an immutable [`test`](#test) task and provides all necessary dependencies and configurations for a proper testing configuration.
## `prepareTestSandbox`
{#prepareTestSandbox}
<tldr>
**Depends on**: `jar`, [`instrumentedJar`](#instrumentedJar)
**Extends**: [`Sync`][gradle-jar-task], [`SandboxProducerAware`](tools_intellij_platform_gradle_plugin_task_awares.md#SandboxProducerAware)
**Sources**: [`PrepareSandboxTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/PrepareSandboxTask.kt)
</tldr>
The [`prepareSandbox`](#prepareSandbox) task instance configured to work with the [`test`](#test) task.
## `printBundledPlugins` ## `printBundledPlugins`
@ -868,6 +1011,7 @@ Prepares an immutable `test` task and provides all necessary dependencies and co
Prints the list of bundled plugins available within the currently targeted IntelliJ Platform. Prints the list of bundled plugins available within the currently targeted IntelliJ Platform.
## `printProductsReleases` ## `printProductsReleases`
{#printProductsReleases} {#printProductsReleases}
@ -886,6 +1030,7 @@ and [`intellijPlatform.pluginConfiguration.ideaVersion.untilBuild`](tools_intell
The filter used for retrieving the release list can be customized by using properties provided with The filter used for retrieving the release list can be customized by using properties provided with
[`ProductReleasesValueSource.FilterParameters`](tools_intellij_platform_gradle_plugin_types.md#ProductReleasesValueSource-FilterParameters). [`ProductReleasesValueSource.FilterParameters`](tools_intellij_platform_gradle_plugin_types.md#ProductReleasesValueSource-FilterParameters).
### `productsReleases` ### `productsReleases`
{#printProductsReleases-productsReleases} {#printProductsReleases-productsReleases}
@ -902,6 +1047,7 @@ See also:
- [Types: `ProductReleasesValueSource.FilterParameters`](tools_intellij_platform_gradle_plugin_types.md#ProductReleasesValueSource-FilterParameters) - [Types: `ProductReleasesValueSource.FilterParameters`](tools_intellij_platform_gradle_plugin_types.md#ProductReleasesValueSource-FilterParameters)
## `publishPlugin` ## `publishPlugin`
{#publishPlugin} {#publishPlugin}
@ -927,7 +1073,7 @@ See also:
{#publishPlugin-archiveFile} {#publishPlugin-archiveFile}
Specifies the ZIP archive file to be published to the remote repository. Specifies the ZIP archive file to be published to the remote repository.
By default, it uses the output `archiveFile` of the [`signPlugin`](#signPlugin) task if plugin signing is configured, otherwise the one from [`buildPlugin`](#buildPlugin). By default, it uses the output [`signPlugin.archiveFile`](#signPlugin-archiveFile) if plugin signing is configured, otherwise the [`buildPlugin.archiveFile`](#buildPlugin-archiveFile).
{style="narrow"} {style="narrow"}
Type Type
@ -972,7 +1118,7 @@ Default value
### `channels` ### `channels`
{#publishPlugin-channels} {#publishPlugin-channels}
Specifies a list of JetBrains Marketplace channel names used as destination for the plugin upload. Specifies a list of [JetBrains Marketplace](https://plugins.jetbrains.com) channel names used as destination for the plugin upload.
{style="narrow"} {style="narrow"}
Type Type
@ -985,7 +1131,7 @@ Default value
### `hidden` ### `hidden`
{#publishPlugin-hidden} {#publishPlugin-hidden}
Publishes the plugin update and marks it as hidden to prevent public visibility after approval. Publishes the plugin update and marks it as [hidden](https://plugins.jetbrains.com/docs/marketplace/hidden-plugin.html) to prevent public visibility after approval.
{style="narrow"} {style="narrow"}
Type Type
@ -994,9 +1140,6 @@ Type
Default value Default value
: [`intellijPlatform.publishing.hidden`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-publishing-hidden) : [`intellijPlatform.publishing.hidden`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-publishing-hidden)
See also:
- [Hidden release](https://plugins.jetbrains.com/docs/marketplace/hidden-plugin.html)
### `ideServices` ### `ideServices`
{#publishPlugin-ideServices} {#publishPlugin-ideServices}
@ -1011,6 +1154,7 @@ Default value
: [`intellijPlatform.publishing.ideServices`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-publishing-ideServices) : [`intellijPlatform.publishing.ideServices`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-publishing-ideServices)
## `runIde` ## `runIde`
{#runIde} {#runIde}
@ -1018,7 +1162,7 @@ Default value
**Depends on**: [`patchPluginXml`](#patchPluginXml), [`prepareSandbox`](#prepareSandbox) **Depends on**: [`patchPluginXml`](#patchPluginXml), [`prepareSandbox`](#prepareSandbox)
**Extends**: [`JavaExec`][gradle-javaexec-task], [`RunnableIdeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RunnableIdeAware) **Extends**: [`JavaExec`][gradle-javaexec-task], [`RunnableIdeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RunnableIdeAware), [`SplitModeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#SplitModeAware), [`IntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#IntelliJPlatformVersionAware)
**Sources**: [`RunIdeTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt) **Sources**: [`RunIdeTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt)
@ -1027,8 +1171,31 @@ Default value
Runs the IDE instance using the currently selected IntelliJ Platform with the built plugin loaded. Runs the IDE instance using the currently selected IntelliJ Platform with the built plugin loaded.
It directly extends the [`JavaExec`][gradle-javaexec-task] Gradle task, which allows for an extensive configuration (system properties, memory management, etc.). It directly extends the [`JavaExec`][gradle-javaexec-task] Gradle task, which allows for an extensive configuration (system properties, memory management, etc.).
This task class also inherits from [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware), This task runs against the IntelliJ Platform and plugins specified in project dependencies.
which makes it possible to create `runIde`-like tasks using custom IntelliJ Platform versions: To register a customized task, use [`intelliJPlatformTestingExtension.runIde`](tools_intellij_platform_gradle_plugin_testing_extension.md).
## `setupDependencies`
{#setupDependencies}
<tldr>
**Extends**: [`DefaultTask`][gradle-default-task]
**Sources**: [`SetupDependenciesTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/SetupDependenciesTask.kt)
</tldr>
A deprecated method for setting up IntelliJ Platform dependencies.
The `setupDependencies` task was automatically added to the ["After Sync" Gradle trigger](https://www.jetbrains.com/help/idea/work-with-gradle-tasks.html#config_triggers_gradle) to make the IntelliJ Platform dependency available for IntelliJ IDEA right after the Gradle synchronization.
This method is no longer needed as the dependency on IntelliJ Platform is declared directly in Gradle dependencies.
> It's recommended to remove any references to `setupDependencies` task. See the [Migration](tools_intellij_platform_gradle_plugin_migration.md#setupdependencies) page for more details.
>
{style="warning"}
## `signPlugin` ## `signPlugin`
@ -1061,8 +1228,6 @@ For more details, see [](plugin_signing.md).
Specifies the unsigned ZIP archive input file. Specifies the unsigned ZIP archive input file.
Corresponds to the `in` CLI option. Corresponds to the `in` CLI option.
By default, it uses the output archive of the [`buildPlugin`](#buildPlugin) task.
{style="narrow"} {style="narrow"}
Type Type
: `RegularFileProperty` : `RegularFileProperty`
@ -1164,6 +1329,8 @@ Default value
Specifies the encoded private key in the PEM format. Specifies the encoded private key in the PEM format.
Corresponds to the `key` CLI option. Corresponds to the `key` CLI option.
Takes precedence over the [`privateKeyFile`](#signPlugin-privateKeyFile) property.
{style="narrow"} {style="narrow"}
Type Type
: `Property<String>` : `Property<String>`
@ -1207,6 +1374,8 @@ Specifies a string containing X509 certificates.
The first certificate in the chain will be used as a certificate authority (CA). The first certificate in the chain will be used as a certificate authority (CA).
This parameter corresponds to the `cert` CLI option. This parameter corresponds to the `cert` CLI option.
Takes precedence over the [`certificateChainFile`](#signPlugin-certificateChainFile) property.
{style="narrow"} {style="narrow"}
Type Type
: `Property<String>` : `Property<String>`
@ -1230,6 +1399,52 @@ Default value
: [`intellijPlatform.signing.certificateChainFile`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-signing-certificateChainFile) : [`intellijPlatform.signing.certificateChainFile`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-signing-certificateChainFile)
## `test`
{#test}
<tldr>
**Depends on**: [`prepareTest`](#prepareTest)
**Extends**: [`DefaultTask`][gradle-default-task], [`IntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#IntelliJPlatformVersionAware), [`PluginAware`](tools_intellij_platform_gradle_plugin_task_awares.md#PluginAware)
**Sources**: [`TestCompanion`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/companion/TestCompanion.kt)
</tldr>
The base Gradle `test` task is preconfigured using the [`TestCompanion`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/companion/TestCompanion.kt) class to run tests with IntelliJ Platform, sandbox, and all system properties set.
The task itself isn't mutated and a dedicated [`prepareTest`](#prepareTest) task is involved to request for required IntelliJ Platform and sandbox configuration.
## `testIde`*
{#testIde}
<tldr>
**Depends on**: [`prepareTest`](#prepareTest)
**Extends**: [`DefaultTask`][gradle-default-task], [`IntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#IntelliJPlatformVersionAware), [`PluginAware`](tools_intellij_platform_gradle_plugin_task_awares.md#PluginAware)
**Sources**: [`TestIdeTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt)
</tldr>
> The `testIde` task is not registered by default.
>
{style="tip"}
Runs plugin tests against the currently selected IntelliJ Platform with the built plugin loaded.
It directly extends the [Test][gradle-test-task] Gradle task, which allows for an extensive configuration (system properties, memory management, etc.).
The [`TestIdeTask`](%gh-ijpgp-master%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt) is a class used only for handling custom `testIde` tasks.
To register a customized test task, use [`intelliJPlatformTestingExtension.testIde`](tools_intellij_platform_gradle_plugin_testing_extension.md).
## `testIdePerformance` ## `testIdePerformance`
{#testIdePerformance} {#testIdePerformance}
@ -1238,12 +1453,25 @@ Default value
{style="warning"} {style="warning"}
## `testIdeUi` ## `testIdeUi`
{#testIdeUi} {#testIdeUi}
> Not implemented. Runs the IDE instance with the developed plugin and Starter framework for UI testing.
>
{style="warning"}
### `archiveFile`
{#testIdeUi-archiveFile}
Specifies the archive file representing the input file to be tested.
{style="narrow"}
Type
: `RegularFileProperty`
Default value
: [`buildPlugin.archiveFile`](#buildPlugin-archiveFile)
## `verifyPluginProjectConfiguration` ## `verifyPluginProjectConfiguration`
@ -1460,6 +1688,7 @@ Default value
: The [](tools_intellij_platform_gradle_plugin_plugins.md#module) plugin presence : The [](tools_intellij_platform_gradle_plugin_plugins.md#module) plugin presence
## `verifyPluginSignature` ## `verifyPluginSignature`
{#verifyPluginSignature} {#verifyPluginSignature}
@ -1521,6 +1750,7 @@ Default value
: [`signPlugin.certificateChainFile`](#signPlugin-certificateChainFile) or [`signPlugin.certificateChain`](#signPlugin-certificateChain) written to a temporary file : [`signPlugin.certificateChainFile`](#signPlugin-certificateChainFile) or [`signPlugin.certificateChain`](#signPlugin-certificateChain) written to a temporary file
## `verifyPluginStructure` ## `verifyPluginStructure`
{#verifyPluginStructure} {#verifyPluginStructure}
@ -1592,6 +1822,7 @@ Default value
: <path>[`prepareSandbox.defaultDestinationDirectory`](#prepareSandbox-defaultDestinationDirectory)/[`intellijPlatform.pluginConfiguration.name`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-name)</path> : <path>[`prepareSandbox.defaultDestinationDirectory`](#prepareSandbox-defaultDestinationDirectory)/[`intellijPlatform.pluginConfiguration.name`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-pluginConfiguration-name)</path>
## `verifyPlugin` ## `verifyPlugin`
{#verifyPlugin} {#verifyPlugin}

View File

@ -0,0 +1,116 @@
<!-- Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license. -->
# IntelliJ Platform Testing Extension
<link-summary>IntelliJ Platform Gradle Plugin testing extension.</link-summary>
<include from="tools_intellij_platform_gradle_plugin.md" element-id="faq"/>
The _IntelliJ Platform Gradle Plugin_ introduces a top-level `intellijPlatformExtension` extension.
It provides a possibility for registering custom tasks for running the IDE, unit tests, UI tests, or performance tests.
For each of the custom tasks, a dedicated sandbox is created to isolate them form other tasks or the build flow as they may rely on a different IntelliJ Platform version, plugins, or other configuration.
## IntelliJ Platform Testing
{#intellijPlatformTesting}
After the IntelliJ Platform Gradle Plugin is [applied](tools_intellij_platform_gradle_plugin.md#usage), the `intellijPlatformTesting` extension can be used for registering new tasks to fulfil specific requirements of the project.
The extension exposes four `NamedDomainObjectContainers` which allow for creating new objects of given types.
Registering of a custom task which allows for adjusting the IntelliJ Platform type and version can be done by using one of the below containers, depending on the task purpose.
**Example:**
```kotlin
intellijPlatformTesting {
runIde
testIde
testIdeUi
testIdePerformance
}
```
By default, created tasks depend on the IntelliJ Platform defined with [](tools_intellij_platform_gradle_plugin_dependencies_extension.md).
However, it is possible to adjust it to any requirements with passing custom values directly to the created object, `task`, or `sandboxTask` task instances.
**Example:**
```kotlin
val runPhpStorm by intellijPlatformTesting.runIde.registering {
type = IntelliJPlatformType.PhpStorm
version = ...
useInstaller = ...
localPath = ...
sandboxDirectory = ...
splitMode = ...
splitModeTarget = ...
task {
...
}
prepareSandboxTask {
...
}
plugins {
...
}
}
```
### `task {}`
Depending on the type of registered object, a different `task` class is available for configuration:
| Type | Task class |
|----------------------|-----------------------------------------------------------------------------------------------|
| `runIde` | [`RunIdeTask`](tools_intellij_platform_gradle_plugin_tasks.md#runIde) |
| `testIde` | [`TestIdeTask`](tools_intellij_platform_gradle_plugin_tasks.md#testIde) |
| `testIdeUi` | [`TestIdeUiTask`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi) |
| `testIdePerformance` | [`TestIdePerformanceTask`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance) |
### `prepareSandboxTask {}`
The `prepareSandboxTask` refers to a dedicated [`PrepareSandboxTask`](tools_intellij_platform_gradle_plugin_tasks.md#prepareSandbox) task instance, connected only with a newly created task.
The name of this task is based on the name of created task, like `prepareSandbox_[TASK_NAME]`.
### `plugins {}`
An extension to provide custom plugins to be added when running the task runtime, or disabling bundled ones.
It provides several methods for adding remote and local plugins, or for disabling already loaded or bundled plugin.
**Example:**
```kotlin
tasks {
val runIdeWithPlugins by intellijPlatformTesting.runIde.registering {
// ...
plugins {
plugin("pluginId", "1.0.0")
disablePlugin("pluginId")
}
}
}
```
| Function | Description |
|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------|
| `plugin(id, version, channel)` | Adds a dependency on a plugin for a custom IntelliJ Platform. |
| `plugin(notation)` | Adds a dependency on a plugin for a custom IntelliJ Platform using a string notation:<p>`pluginId:version` or `pluginId:version@channel`</p> |
| `plugins(notations)` | Adds dependencies on plugins for a custom IntelliJ Platform using a string notation:<p>`pluginId:version` or `pluginId:version@channel`</p> |
| `disablePlugin(id)` | Disables the specific plugin with its ID. |
| `disablePlugins(ids)` | Disables specific plugins with the list of their IDs. |
| `localPlugin(path)` | Adds a dependency on a local IntelliJ Platform plugin. Accepts path or a dependency on another module. |
| `robotServerPlugin(version)` | Adds a dependency on a Robot Server Plugin. |
<include from="snippets.md" element-id="missingContent"/>