diff --git a/ijs.tree b/ijs.tree index b4051aefd..9ac5b7eba 100644 --- a/ijs.tree +++ b/ijs.tree @@ -419,6 +419,7 @@ + diff --git a/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_custom_tasks.md b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_custom_tasks.md new file mode 100644 index 000000000..ddfb01bc5 --- /dev/null +++ b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_custom_tasks.md @@ -0,0 +1,132 @@ + + +# Custom Tasks + +IntelliJ Platform Gradle Plugin custom tasks. + + + + +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} + + + +**Extends**: [`runIde`](tools_intellij_platform_gradle_plugin_tasks.md#runIde), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware) + +**Sources**: [`CustomRunIdeTask`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomRunIdeTask.kt) + + + +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} + + + +**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%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomTestIdeTask.kt) + + + +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} + + + +**Extends**: [`testIdeUi`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware) + +**Sources**: [`CustomTestIdeUiTask`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomTestIdeUiTask.kt) + + + +> Not implemented. +> +{style="warning"} + + +## `CustomTestIdePerformanceTask` +{#CustomTestIdePerformanceTask} + + + +**Extends**: [`testIdePerformance`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware) + +**Sources**: [`CustomTestIdePerformanceTask`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/CustomTestIdePerformanceTask.kt) + + + +> Not implemented. +> +{style="warning"} + + + + +[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 diff --git a/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_task_awares.md b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_task_awares.md index 07abe02ae..f78ad1fd4 100644 --- a/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_task_awares.md +++ b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_task_awares.md @@ -60,7 +60,7 @@ Default value **Depends on**: [`initializeIntelliJPlatformPlugin`](tools_intellij_platform_gradle_plugin_tasks.md#initializeIntelliJPlatformPlugin) -**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware) +**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware), [`TestableAware`](#TestableAware) **Sources**: [`CoroutinesJavaAgentAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/CoroutinesJavaAgentAware.kt) @@ -88,7 +88,7 @@ Default value **Depends on**: [`IntelliJPlatformVersionAware`](#IntelliJPlatformVersionAware) -**Inherited by**: [`SandboxAware`](#SandboxAware), [`runIde`](tools_intellij_platform_gradle_plugin_tasks.md#runIde), [`testIde`](tools_intellij_platform_gradle_plugin_tasks.md#testIde), [`testIdePerformance`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance), [`testIdeUi`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi) +**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%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/CustomIntelliJPlatformVersionAware.kt) @@ -143,13 +143,14 @@ Type {#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(RunIdeTask::class) { + val runIdeWithPlugins by registering(CustomRunIdeTask::class) { // ... plugins { plugin("pluginId", "1.0.0") @@ -173,7 +174,7 @@ tasks { -**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), [`verifyPluginProjectConfiguration`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPluginProjectConfiguration) +**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) **Sources**: [`IntelliJPlatformVersionAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/IntelliJPlatformVersionAware.kt) @@ -268,7 +269,7 @@ Type **Depends on**: [`patchPluginXml`](tools_intellij_platform_gradle_plugin_tasks.md#patchPluginXml) -**Inherited by**: [`TestableAware`](#TestableAware), [`RunnableIdeAware`](#RunnableIdeAware), [`jarSearchableOptions`](tools_intellij_platform_gradle_plugin_tasks.md#jarSearchableOptions) +**Inherited by**: [`TestableAware`](#TestableAware), [`RunnableIdeAware`](#RunnableIdeAware), [`jarSearchableOptions`](tools_intellij_platform_gradle_plugin_tasks.md#jarSearchableOptions), [`verifyPluginProjectConfiguration`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPluginProjectConfiguration) **Sources**: [`PluginAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/PluginAware.kt) @@ -342,9 +343,9 @@ Type -**Depends on**: [`AutoReloadAware`](#AutoReloadAware), [`CoroutinesJavaAgentAware`](#CoroutinesJavaAgentAware), [`PluginAware`](#PluginAware), [`RuntimeAware`](#RuntimeAware), [`SandboxAware`](#SandboxAware), [`SplitModeAware`](#SplitModeAware), [`initializeIntelliJPlatformPlugin`](tools_intellij_platform_gradle_plugin_tasks.md#initializeIntelliJPlatformPlugin) +**Depends on**: [`AutoReloadAware`](#AutoReloadAware), [`CoroutinesJavaAgentAware`](#CoroutinesJavaAgentAware), [`PluginAware`](#PluginAware), [`RuntimeAware`](#RuntimeAware), [`SandboxAware`](#SandboxAware), [`SplitModeAware`](#SplitModeAware) -**Inherited by**: [`buildSearchableOptions`](tools_intellij_platform_gradle_plugin_tasks.md#buildSearchableOptions), [`runIde`](tools_intellij_platform_gradle_plugin_tasks.md#runIde), [`testIde`](tools_intellij_platform_gradle_plugin_tasks.md#testIde), [`testIdePerformance`](tools_intellij_platform_gradle_plugin_tasks.md#testIdePerformance), [`testIdeUi`](tools_intellij_platform_gradle_plugin_tasks.md#testIdeUi) +**Inherited by**: [`buildSearchableOptions`](tools_intellij_platform_gradle_plugin_tasks.md#buildSearchableOptions), [`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) **Sources**: [`RunnableIdeAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/RunnableIdeAware.kt) @@ -364,7 +365,7 @@ Inherits from: -**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware), [`TestableAware`](#TestableAware), [`verifyPlugin`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPlugin) +**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware), [`TestableAware`](#TestableAware), [`verifyPlugin`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPlugin), [`verifyPluginProjectConfiguration`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPluginProjectConfiguration) **Sources**: [`RuntimeAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/RuntimeAware.kt) @@ -420,7 +421,7 @@ Type **Depends on**: [`prepareSandbox`](tools_intellij_platform_gradle_plugin_tasks.md#prepareSandbox) -**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware), [`SandboxProducerAware`](#SandboxProducerAware), [`jarSearchableOptions`](tools_intellij_platform_gradle_plugin_tasks.md#jarSearchableOptions), [`prepareSandbox`](tools_intellij_platform_gradle_plugin_tasks.md#prepareSandbox), [`verifyPluginStructure`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPluginStructure) +**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware), [`SandboxProducerAware`](#SandboxProducerAware), [`jarSearchableOptions`](tools_intellij_platform_gradle_plugin_tasks.md#jarSearchableOptions), [`verifyPluginStructure`](tools_intellij_platform_gradle_plugin_tasks.md#verifyPluginStructure) **Sources**: [`SandboxAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/SandboxAware.kt) @@ -542,7 +543,7 @@ Type -**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware) +**Inherited by**: [`RunnableIdeAware`](#RunnableIdeAware), [`prepareSandbox`](tools_intellij_platform_gradle_plugin_tasks.md#prepareSandbox) **Sources**: [`SplitModeAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/SplitModeAware.kt) @@ -556,18 +557,28 @@ The developed plugin is installed in the backend part. Split Mode requires the IntelliJ Platform in the version `241.14473` or later. +### `splitMode` +{#SplitModeAware-splitMode} + +Enables Split Mode when running the IDE. + +{style="narrow"} +Type +: `DirectoryProperty` + + ## `TestableAware` {#TestableAware} -**Inherited by**: [`prepareTest`](tools_intellij_platform_gradle_plugin_tasks.md#prepareTest), [`testIde`](tools_intellij_platform_gradle_plugin_tasks.md#testIde) +**Inherited by**: [`prepareTest`](tools_intellij_platform_gradle_plugin_tasks.md#prepareTest), [`CustomTestIdeTask`](tools_intellij_platform_gradle_plugin_custom_tasks.md#CustomTestIdeTask) **Sources**: [`TestableAware`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/aware/TestableAware.kt) -Interface used to describe tasks used for running tests, such as a customizable [`testIde`](tools_intellij_platform_gradle_plugin_tasks.md#testIde) 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 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. diff --git a/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_tasks.md b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_tasks.md index 1a2db4be1..15afe9d67 100644 --- a/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_tasks.md +++ b/topics/appendix/tools/intellij_platform_gradle_plugin/tools_intellij_platform_gradle_plugin_tasks.md @@ -51,7 +51,6 @@ flowchart LR subgraph TEST ["Test"] prepareTest - testIde testIdePerformance>testIdePerformance] testIdeUi>testIdeUi] @@ -101,7 +100,6 @@ flowchart LR prepareTest --> prepareSandbox_patchPluginXml test --> prepareTest - testIde --> prepareSandbox_patchPluginXml testIdePerformance testIdeUi @@ -126,7 +124,6 @@ flowchart LR click runIde "#runIde" click prepareTest "#prepareTest" - click testIde "#testIde" click testIdePerformance "#testIdePerformance" click testIdeUi "#testIdeUi" @@ -792,7 +789,7 @@ See also: Prepares a sandbox environment with the installed plugin and its dependencies. -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), [`testIde`](#testIde), [`testIdeUi`](#testIdeUi), or [`testIdePerformance`](#testIdePerformance) tasks. +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. To fully use the sandbox capabilities in a task, extend from [`SandboxAware`](tools_intellij_platform_gradle_plugin_task_awares.md#SandboxAware) interface. @@ -1042,7 +1039,7 @@ Default value **Depends on**: [`patchPluginXml`](#patchPluginXml), [`prepareSandbox`](#prepareSandbox) -**Extends**: [`JavaExec`][gradle-javaexec-task], [`RunnableIdeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RunnableIdeAware), [`CustomIntelliJPlatformVersionAware`](tools_intellij_platform_gradle_plugin_task_awares.md#CustomIntelliJPlatformVersionAware) +**Extends**: [`JavaExec`][gradle-javaexec-task], [`RunnableIdeAware`](tools_intellij_platform_gradle_plugin_task_awares.md#RunnableIdeAware) **Sources**: [`RunIdeTask`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/RunIdeTask.kt) @@ -1053,21 +1050,6 @@ It directly extends the [`JavaExec`][gradle-javaexec-task] Gradle task, which al 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.RunIdeTask - -tasks { - val runPhpStorm by registering(RunIdeTask::class) { - type = IntelliJPlatformType.PhpStorm - version = "2023.2.2" - } - - val runLocalIde by registering(RunIdeTask::class) { - localPath = file("/Users/user/Applications/Android Studio.app") - } -} -``` ## `signPlugin` {#signPlugin} @@ -1266,41 +1248,6 @@ Default value : [`intellijPlatform.signing.certificateChainFile`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-signing-certificateChainFile) -## `testIde` -{#testIde} - - - -**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**: [`TestIdeTask`](%gh-ijpgp%/src/main/kotlin/org/jetbrains/intellij/platform/gradle/tasks/TestIdeTask.kt) - - - -> This task is not registered with the `testIde` name, but its configuration extends the default `test` task. - -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 `testIde`-like tasks using custom IntelliJ Platform versions: - -```kotlin -import org.jetbrains.intellij.platform.gradle.IntelliJPlatformType -import org.jetbrains.intellij.platform.gradle.tasks.TestIdeTask - -tasks { - val testPhpStorm by registering(TestIdeTask::class) { - type = IntelliJPlatformType.PhpStorm - version = "2023.2.2" - } - - val testLocalIde by registering(TestIdeTask::class) { - localPath = file("/Users/user/Applications/Android Studio.app") - } -} -``` - - ## `testIdePerformance` {#testIdePerformance}