mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 02:07:50 +08:00
Incorp review comments
This commit is contained in:
parent
253e27b2da
commit
abd72e0dc9
@ -13,7 +13,6 @@ Details particular to an IntelliJ Platform-based IDE is described on the individ
|
||||
|
||||
## Introduction
|
||||
Plugins can extend or add functionality to IDEs based on the IntelliJ Platform.
|
||||
This extensibility applies to a variety of JetBrains' IDEs, such as Android Studio, WebStorm, PhpStorm, and PyCharm.
|
||||
Plugins can be written in Kotlin or Java, or a mix of both, and are created using IntelliJ IDEA.
|
||||
Once completed, plugins can be packaged and distributed at [plugins.jetbrains.com](https://plugins.jetbrains.com).
|
||||
|
||||
@ -44,29 +43,35 @@ The product version is 2019.2.3.
|
||||
|
||||
If the product version isn't clear on the _About_ screen, consult the individual product pages in Part VIII.
|
||||
|
||||
Using [Toolbox](https://www.jetbrains.com/toolbox-app/) is an easy way to find build numbers for recent versions.
|
||||
The [Other IntelliJ IDEA Versions](https://www.jetbrains.com/idea/download/other.html) page is a quick way to find build numbers for every version back to v11.0.
|
||||
In the example below, IntelliJ IDEA Community (which defines the IntelliJ Platform) for v2019.2.3 is build number `192.6817.14`.
|
||||
|
||||
{:width="400px"}
|
||||
{:width="600px"}
|
||||
|
||||
Although the FIX versions are different, this is not uncommon between products, and the builds are still compatible.
|
||||
The BRANCH and BUILD numbers match, therefor in this PyCharm example:
|
||||
* The _targetIDE_ (PyCharm) is `192.6817.19`,
|
||||
* The _targetIDE_ is PyCharm, version `192.6817.19`,
|
||||
* The _baseIntelliJPlatformVersion_ (IntelliJ IDEA Community Edition) is `192.6817.14`
|
||||
|
||||
### Configuring the Plugin build.gradle File
|
||||
For a project developing a plugin for _targetIDE_, configure the `build.gradle` file as follows:
|
||||
* The Gradle plugin attributes describing the configuration of the [IntelliJ Platform used to build the plugin project](/tutorials/build_system/gradle_guide.md#configuring-the-gradle-plugin-for-building-intellij-platform-plugin-projects) must be explicitly set.
|
||||
The `intellij.type` is "IC" because the IntelliJ IDEA Community Edition defines the IntelliJ Platform.
|
||||
The `intellij.version` is _baseIntelliJPlatformVersion_.
|
||||
* Declare the [plugin's dependency](/tutorials/build_system/gradle_guide.md#plugin-dependencies) on any _targetIDE_-specific plugins or modules.
|
||||
Use the Gradle plugin attribute `intellij.plugins` to declare a dependency.
|
||||
See the specific product pages in Part VIII for the _targetIDE_ plugin or module name.
|
||||
* The best practice is to use a local installation of _targetIDE_ as the [IDE Development Instance](/basics/ide_development_instance.md).
|
||||
Set the Development Instance to the (user-specific) absolute path to the _targetIDE_ application.
|
||||
The exact path varies by the operating system; macOS is shown.
|
||||
This information is used to configure the plugin project's `build.gradle` and `plugin.xml` files.
|
||||
|
||||
The snippet below is an example of configuring the Setup and Running DSLs in a `build.gradle` specific to developing a plugin for _targetIDE_.
|
||||
### Configuring the Plugin build.gradle File
|
||||
Configuring a Gradle plugin project for _targetIDE_ requires changing some of the default settings in the `build.gradle` file.
|
||||
Changes need to be made in two tasks: `intellij {}` and `runIde {}`.
|
||||
|
||||
The Gradle plugin attributes describing the configuration of the [IntelliJ Platform used to build the plugin project](/tutorials/build_system/gradle_guide.md#configuring-the-gradle-plugin-for-building-intellij-platform-plugin-projects) must be explicitly set in the `intellij {}` task.
|
||||
The `intellij.type` is "IC" because the IntelliJ IDEA Community Edition defines the IntelliJ Platform.
|
||||
The `intellij.version` is _baseIntelliJPlatformVersion_.
|
||||
|
||||
Any [dependencies](/tutorials/build_system/gradle_guide.md#plugin-dependencies) on _targetIDE_-specific plugins or modules must be declared in the `intellij {}` task.
|
||||
Use the Gradle plugin attribute `intellij.plugins` to declare a dependency.
|
||||
See the specific product pages in Part VIII for the _targetIDE_ plugin or module name.
|
||||
|
||||
The best practice is to modify the `runIde {}` task to use a local installation of _targetIDE_ as the [IDE Development Instance](/basics/ide_development_instance.md).
|
||||
Set the `runIde.ideaDirectory` attribute to the (user-specific) absolute path of the _targetIDE_ application.
|
||||
The exact path format varies by operating system.
|
||||
|
||||
This snippet is an template for configuring the Setup and Running DSLs in a `build.gradle` specific to developing a plugin for _targetIDE_.
|
||||
```groovy
|
||||
intellij {
|
||||
// Define IntelliJ Platform against which to build the plugin project.
|
||||
|
BIN
products/img/idea_lookup.png
Normal file
BIN
products/img/idea_lookup.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 111 KiB |
Binary file not shown.
Before Width: | Height: | Size: 101 KiB |
Loading…
x
Reference in New Issue
Block a user