ide_development_instance.md: update for Gradle 2.x plugin

This commit is contained in:
Yann Cébron 2024-08-15 16:39:07 +02:00
parent 96ab41e672
commit 418e16915d

View File

@ -4,15 +4,21 @@
<link-summary>Overview of IDE instance used for running and debugging a plugin during development.</link-summary>
A JetBrains feature for developing plugins is running or debugging a plugin project from within IntelliJ IDEA.
Selecting the [`runIde`](creating_plugin_project.md#running-a-plugin-with-the-runide-gradle-task) task for a Gradle-based project (or [Run](running_and_debugging_a_theme.md) menu for a DevKit-based project) will launch a _Development Instance_ of the IDE with the plugin enabled.
A plugin project can be run or debugged from within the development instance of IntelliJ IDEA.
Selecting the `runIde` task for a Gradle-based project (or [Run](running_and_debugging_a_theme.md) menu for a Plugin DevKit-based project)
will launch a _Development Instance_ of the target IDE with the current development version of the plugin enabled.
This page describes how to control some settings for the Development Instance.
> See also [`runIde` task](tools_gradle_intellij_plugin.md#tasks-runide) properties and [Advanced Configuration](https://www.jetbrains.com/help/idea/tuning-the-ide.html) for general VM options and properties.
> See also `runIde` task (Reference: [2.x](tools_intellij_platform_gradle_plugin_tasks.md#runIde), [1.x](tools_gradle_intellij_plugin.md#tasks-runide)) properties and [Advanced Configuration](https://www.jetbrains.com/help/idea/tuning-the-ide.html) for general VM options and properties.
>
## Using a JetBrains Runtime for the Development Instance
> See [](tools_intellij_platform_gradle_plugin_jetbrains_runtime.md) when using [](tools_intellij_platform_gradle_plugin.md).
>
{title="IntelliJ Platform Gradle Plugin (2.x)"}
An everyday use case is to develop (build) a plugin project against a JDK, e.g., Java 17, and then run or debug the plugin in a Development Instance of the IDE.
In such a situation, Development Instance must use a [JetBrains Runtime (JBR)](https://www.jetbrains.com/jetbrains-runtime) rather than the JDK used to build the plugin project.
@ -21,18 +27,18 @@ It has some modifications by JetBrains, such as fixes for native crashes not pre
A version of the JetBrains Runtime is bundled with all IntelliJ Platform-based IDEs.
To produce accurate results while running or debugging a plugin project in a Development Instance, follow the procedures below to ensure the Development Instance uses a JetBrains Runtime.
### Using JetBrains Runtime in Gradle and DevKit
### Using JetBrains Runtime
<tabs group="project-type">
<tab title="Gradle" group-key="gradle">
<tab title="Gradle IntelliJ Plugin (1.x)" group-key="gradle">
By default, the Gradle plugin will fetch and use the version of the JetBrains Runtime for the Development Instance corresponding to the version of the IntelliJ Platform used for building the plugin project.
If required, an alternative version can be specified using [`runIde.jbrVersion`](tools_gradle_intellij_plugin.md#tasks-runide-jbrversion) task property.
</tab>
<tab title="DevKit" group-key="devkit">
<tab title="Plugin DevKit" group-key="devkit">
The [Run Configuration](https://www.jetbrains.com/help/idea/run-debug-configuration.html) for a DevKit-based plugin project controls the JDK used to run and debug a plugin project in a Development Instance.
The default Run Configuration uses the same JDK for building the plugin project and running the plugin in a Development Instance.
@ -59,6 +65,7 @@ If a plugin is developed against the Java 8 SE Development Kit 8 for macOS (<pat
For example, `jbrx-8u252-osx-x64` matches the Java 8 JDK, build 252: `jdk-8u252-macosx-x64`.
* Pick the highest JetBrains Runtime build number available.
For example, the file is <path>jbrx-8u252-osx-x64-b1649.2.tar.gz</path>, meaning build 1649.2 for this JetBrains Runtime matching Java 8 JDK build 252.
</procedure>
### JetBrains Runtime Variants
@ -66,6 +73,7 @@ If a plugin is developed against the Java 8 SE Development Kit 8 for macOS (<pat
The JetBrains Runtime is delivered in various variants used for different purposes, like debugging, running for development purposes, or bundling with the IDE.
Available JBR variants are:
- `jcef` - the release bundles with the [JCEF](jcef.md) browser engine
- `sdk` - JBR SDK bundle used for development purposes
- `fd` - the fastdebug bundle which also includes the `jcef` module
@ -79,6 +87,8 @@ Available JBR variants are:
## Enabling Auto-Reload
<primary-label ref="2020.1"/>
Starting in 2020.1, this is available for compatible [dynamic plugins](dynamic_plugins.md).
This allows a much faster development cycle by avoiding a full restart of the development instance after detecting code changes (when JARs are modified).
@ -86,66 +96,92 @@ Please note that any unloading problems in a production environment will ask the
> Auto-Reload does not work when the sandbox IDE instance is running under a debugger.
>
{style="warning"}
{style="warning" title="Debugging"}
<tabs group="project-type">
### IntelliJ Platform Gradle Plugin (2.x)
<tab title="Gradle" group-key="gradle">
Auto-Reload is enabled by default.
Enabled by default for target platform 2020.2 or later.
Set property [`intellijPlatform.autoReload`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-autoReload) to `false` to disable it explicitly,
see [](tools_intellij_platform_gradle_plugin_faq.md#how-to-disable-the-automatic-reload-of-dynamic-plugins)
Set property [`runIde.autoReloadPlugins`](tools_gradle_intellij_plugin.md#tasks-runide-autoreloadplugins) to `true` for enabling it in earlier platform versions or `false` to disable it explicitly, see [](tools_gradle_intellij_plugin_faq.md#how-to-disable-automatic-reload-of-dynamic-plugins).
After starting the sandbox IDE instance, run the [`buildPlugin`](tools_intellij_platform_gradle_plugin_tasks.md#buildPlugin) task after modifications
in the plugin project and switch back focus to the sandbox instance to trigger reload.
After starting the sandbox IDE instance, run [`buildPlugin`](tools_gradle_intellij_plugin.md#tasks-buildplugin) task after modifications in the plugin project and switch focus back to sandbox instance to trigger reload.
> [`buildSearchableOptions`](tools_gradle_intellij_plugin.md#tasks-buildsearchableoptions) task must currently be [disabled explicitly](tools_gradle_intellij_plugin_faq.md#how-to-disable-building-searchable-options) to workaround _Only one instance of IDEA can be run at a time_ problem.
> [`buildSearchableOptions`](tools_intellij_platform_gradle_plugin_tasks.md#buildSearchableOptions) task must currently be
> [disabled explicitly](tools_intellij_platform_gradle_plugin_faq.md#how-to-disable-building-the-searchable-options) to work around
> _Only one instance of IDEA can be run at a time_ problem.
>
{style="warning"}
</tab>
### Gradle IntelliJ Plugin (1.x)
<tab title="DevKit" group-key="devkit">
{collapsible="true" default-state="collapsed"}
Auto-Reload is enabled by default for target platform 2020.2 or later.
Set property [`runIde.autoReloadPlugins`](tools_gradle_intellij_plugin.md#tasks-runide-autoreloadplugins) to `true` for enabling it in earlier platform versions or `false` to disable it explicitly,
see [](tools_gradle_intellij_plugin_faq.md#how-to-disable-automatic-reload-of-dynamic-plugins)
After starting the sandbox IDE instance, run the [`buildPlugin`](tools_gradle_intellij_plugin.md#tasks-buildplugin) task after modifications in the plugin project
and switch focus back to the sandbox instance to trigger reload.
> [`buildSearchableOptions`](tools_gradle_intellij_plugin.md#tasks-buildsearchableoptions) task must currently be
> [disabled explicitly](tools_gradle_intellij_plugin_faq.md#how-to-disable-building-searchable-options) to work around
> _Only one instance of IDEA can be run at a time_ problem.
>
{style="warning"}
### Plugin DevKit
{collapsible="true" default-state="collapsed"}
Add system property `idea.auto.reload.plugins` in the Plugin DevKit [run configuration](running_and_debugging_a_theme.md).
To disable auto-reload, set `idea.auto.reload.plugins` to `false` explicitly (2020.1.2+).
</tab>
</tabs>
## The Development Instance Sandbox Directory
The _Sandbox Home_ directory contains the [settings, caches, logs, and plugins](#development-instance-settings-caches-logs-and-plugins) for a Development Instance of the IDE.
This information is stored in a different location than for the [installed IDE itself](https://intellij-support.jetbrains.com/hc/en-us/articles/206544519-Directories-used-by-the-IDE-to-store-settings-caches-plugins-and-logs).
<tabs group="project-type">
<tab title="Gradle" group-key="gradle">
### IntelliJ Platform Gradle Plugin (2.x) {id="sandboxGradle2"}
The default Sandbox Home location in a [](tools_intellij_platform_gradle_plugin.md) plugin project is:
* Windows: <path>\$PROJECT_DIRECTORY\$\\build\\\$TARGET_IDE\$\\idea-sandbox</path>
* Linux/macOS: <path>\$PROJECT_DIRECTORY\$/build/\$TARGET_IDE\$/idea-sandbox</path>
The Sandbox Home location can be configured with the [`intellijPlatform.sandboxContainer`](tools_intellij_platform_gradle_plugin_extension.md#intellijPlatform-sandboxContainer) property.
### Gradle IntelliJ Plugin (1.x) {id="sandboxGradle1"}
{collapsible="true" default-state="collapsed"}
The default Sandbox Home location in a [](tools_gradle_intellij_plugin.md) plugin project is:
The default Sandbox Home location in a plugin Gradle project is:
* Windows: <path>\$PROJECT_DIRECTORY\$\\build\\idea-sandbox</path>
* Linux/macOS: <path>\$PROJECT_DIRECTORY\$/build/idea-sandbox</path>
The Sandbox Home location can be configured with the [`intellij.sandboxDir`](tools_gradle_intellij_plugin.md#intellij-extension-sandboxdir) property.
</tab>
### Plugin DevKit {id="sandboxPluginDevKit"}
<tab title="DevKit" group-key="devkit">
{collapsible="true" default-state="collapsed"}
For DevKit-based plugins, the default <control>Sandbox Home</control> location is defined in the IntelliJ Platform Plugin SDK.
For Plugin DevKit-based plugins, the default <control>Sandbox Home</control> location is defined in the IntelliJ Platform Plugin SDK.
See the [Setting Up a Theme Development Environment](setting_up_theme_environment.md#add-intellij-platform-plugin-sdk) for information about how to set up Sandbox Home in IntelliJ Platform SDK.
The default Sandbox Home directory location is:
* Windows: <path>\$USER_HOME\$\\.\$PRODUCT_SYSTEM_NAME\$\$PRODUCT_VERSION\$\\system\\plugins-sandbox\\</path>
* Linux: <path>~/.\$PRODUCT_SYSTEM_NAME\$\$PRODUCT_VERSION\$/system/plugins-sandbox/</path>
* macOS: <path>~/Library/Caches/\$PRODUCT_SYSTEM_NAME\$\$PRODUCT_VERSION\$/plugins-sandbox/</path>
</tab>
</tabs>
### Development Instance Settings, Caches, Logs, and Plugins
Within the Sandbox Home directory are subdirectories of the Development Instance:
* <path>config</path> contains settings for the IDE instance.
* <path>plugins</path> contains folders for each plugin being run in the IDE instance.
* <path>system/caches</path> or <path>system\caches</path> holds the IDE instance data.