mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
plugin_dependencies.md: minor edits
This commit is contained in:
parent
a5ecea07d1
commit
673e00475b
@ -20,19 +20,19 @@ Depending on the chosen development workflow (Gradle or DevKit), one of the two
|
||||
### 2.1 Gradle
|
||||
> **NOTE** Please see the `plugins` attribute [gradle-intellij-plugin: Configuration](https://github.com/JetBrains/gradle-intellij-plugin#configuration) for acceptable values.
|
||||
|
||||
If the project is using [Gradle](/tutorials/build_system.md) with a Groovy build script to build the plugin, add the dependency to the `plugins` parameter of the `intellij` block in your build.gradle, for example:
|
||||
If the project is using [Gradle](/tutorials/build_system.md) with a Groovy build script to build the plugin, add the dependency to the `plugins` parameter of the `intellij` block in your `build.gradle`, for example:
|
||||
|
||||
```groovy
|
||||
intellij {
|
||||
plugins 'org.jetbrains.kotlin:1.3.11-release-IJ2018.3-1'
|
||||
plugins 'org.another.plugin:1.0'
|
||||
}
|
||||
```
|
||||
|
||||
If the project is using [Gradle](/tutorials/build_system.md) with a Kotlin build script to build the plugin, use `setPlugins()` within the `intellij` block, for example:
|
||||
When using Kotlin build script, use `setPlugins()` within the `intellij` block, for example:
|
||||
|
||||
```kotlin
|
||||
intellij {
|
||||
setPlugins("org.jetbrains.kotlin:1.3.11-release-IJ2018.3-1")
|
||||
setPlugins("org.another.plugin:1.0")
|
||||
}
|
||||
```
|
||||
|
||||
@ -62,7 +62,7 @@ In the `plugin.xml`, add a `<depends>` tag with the ID of the dependency plugin
|
||||
Continuing with the example from [Section 2](#2-project-setup) above, the dependency declaration in `plugin.xml` would be:
|
||||
|
||||
```xml
|
||||
<depends>org.jetbrains.kotlin</depends>
|
||||
<depends>org.another.plugin</depends>
|
||||
```
|
||||
|
||||
|
||||
@ -74,6 +74,8 @@ add `optional="true" config-file="otherconfig.xml"` to the `<depends>` tag.
|
||||
For example, if a plugin project adds additional highlighting for Java and Kotlin files, use the following setup.
|
||||
The main `plugin.xml` will define an annotator for Java and specify an optional dependency on the Kotlin plugin:
|
||||
|
||||
_plugin.xml_
|
||||
|
||||
```xml
|
||||
<idea-plugin>
|
||||
...
|
||||
@ -87,6 +89,8 @@ The main `plugin.xml` will define an annotator for Java and specify an optional
|
||||
|
||||
Then create a file called `withKotlin.xml`, in the same directory as the main `plugin.xml` file. In that file, define an annotator for Kotlin:
|
||||
|
||||
_withKotlin.xml_
|
||||
|
||||
```xml
|
||||
<idea-plugin>
|
||||
<extensions defaultExtensionNs="com.intellij">
|
||||
|
Loading…
x
Reference in New Issue
Block a user