mirror of
https://github.com/JetBrains/intellij-sdk-code-samples.git
synced 2025-07-30 18:27:49 +08:00
replace "gradle.build" with the "Gradle build script" term and add Kotlin/Groovy tabs in edited pages
This commit is contained in:
parent
fafb62799e
commit
90e1468c32
@ -8,16 +8,29 @@ This allows each plugin to use a different library version, even if the same lib
|
||||
## Overriding IDE Dependencies
|
||||
|
||||
Gradle 7 introduced `implementation` scope, replacing `compile` scope.
|
||||
For this setup, to use project defined dependency instead of the bundled IDE version, add this snippet to your <path>build.gradle.kts</path>:
|
||||
For this setup, to use project defined dependency instead of the bundled IDE version, add the following snippet to your Gradle build script:
|
||||
|
||||
<tabs>
|
||||
<tab title="Kotlin">
|
||||
|
||||
```kotlin
|
||||
configurations {
|
||||
all {
|
||||
resolutionStrategy.sortArtifacts(ResolutionStrategy.SortOrder.DEPENDENCY_FIRST)
|
||||
}
|
||||
configurations.all {
|
||||
resolutionStrategy.sortArtifacts(ResolutionStrategy.SortOrder.DEPENDENCY_FIRST)
|
||||
}
|
||||
```
|
||||
|
||||
</tab>
|
||||
<tab title="Groovy">
|
||||
|
||||
```groovy
|
||||
configurations.all {
|
||||
resolutionStrategy.sortArtifacts(ResolutionStrategy.SortOrder.DEPENDENCY_FIRST)
|
||||
}
|
||||
```
|
||||
|
||||
</tab>
|
||||
</tabs>
|
||||
|
||||
## Classes from Plugin Dependencies
|
||||
|
||||
By default, the main IDE class loader loads classes that are not found in the plugin class loader.
|
||||
|
@ -67,23 +67,28 @@ Depending on the chosen development workflow (Gradle or DevKit), one of the two
|
||||
>
|
||||
{type="note"}
|
||||
|
||||
If the project uses [Gradle](gradle_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 <path>build.gradle</path>, for example:
|
||||
If the project uses [Gradle](gradle_build_system.md), add the dependency to the `plugins` parameter of the `intellij` block in your build script:
|
||||
|
||||
<tabs>
|
||||
<tab title="Kotlin">
|
||||
|
||||
```kotlin
|
||||
intellij {
|
||||
plugins.set(listOf("com.example.another-plugin:1.0"))
|
||||
}
|
||||
```
|
||||
|
||||
</tab>
|
||||
<tab title="Groovy">
|
||||
|
||||
<path>build.gradle</path>
|
||||
```groovy
|
||||
intellij {
|
||||
plugins = ['com.example.another-plugin:1.0']
|
||||
}
|
||||
```
|
||||
|
||||
When using Kotlin build script, use `plugins.set()` within the `intellij` block, for example:
|
||||
|
||||
<path>build.gradle.kts</path>
|
||||
```kotlin
|
||||
intellij {
|
||||
plugins.set(listOf("com.example.another-plugin:1.0"))
|
||||
}
|
||||
```
|
||||
</tab>
|
||||
</tabs>
|
||||
|
||||
> Transitive dependencies required for tests must currently be [specified explicitly](https://github.com/JetBrains/gradle-intellij-plugin/issues/38).
|
||||
>
|
||||
|
@ -55,7 +55,7 @@ Consistent text styles are used to standardize references and keywords:
|
||||
* Non-code keywords and quotations, or the names of non-code files, are formatted as italic style: \_UI Theme\_ (_UI Theme_), \_README.md\_ (_README.md_.)
|
||||
Examples of this file type include _LICENSE.txt_ and _README.md_.
|
||||
* Code keywords and classnames are formatted as code style: \`interface\`: `interface`, \`AnAction\`: `AnAction`, \`name\` attribute: `name` attribute.
|
||||
* File names are wrapped using `<path>`: `<path>build.gradle</path>` <path>build.gradle</path>.
|
||||
* File names are wrapped using `<path>`: `<path>build.gradle.kts</path>` <path>build.gradle.kts</path>.
|
||||
* File formats are shown as all capital letters: PNG and XML.
|
||||
* Filename extensions are not capitalized when part of a full filename, path, or URL: <path>filename.ext</path>.
|
||||
* Keyboard shortcuts are wrapped using `<shortcut>`: `press <shortcut>Alt+Insert</shortcut>` becomes "press <shortcut>Alt+Insert</shortcut>".
|
||||
|
@ -31,29 +31,29 @@ In this case, the (BRANCH.BUILD.FIX) version of the IntelliJ Platform is `211.76
|
||||
In your Gradle build script, you should set both versions – build number and the release number – to the `intellij.version` property.
|
||||
To figure out the exact release number based on the build number, visit the [IntelliJ Repository Releases](https://www.jetbrains.com/intellij-repository/releases/) listing and check the `com.jetbrains.intellij.idea` section.
|
||||
|
||||
The [build.gradle configuration steps](#configuring-the-plugin-buildgradle-file) section below explains how to set the IntelliJ Platform version to match the target version of Android Studio.
|
||||
The [Gradle build script configuration steps](#configuring-the-plugins-gradle-build-script) section below explains how to set the IntelliJ Platform version to match the target version of Android Studio.
|
||||
|
||||
{width="600"}
|
||||
|
||||
### Android Studio Releases Listing
|
||||
|
||||
Below you may find a list of recent Android Studio releases mapped to the relevant IntelliJ IDEA versions:
|
||||
Below, you may find a list of recent Android Studio releases mapped to the relevant IntelliJ IDEA versions:
|
||||
|
||||
<include src="android_studio_releases.md" include-id="releases_table_short"></include>
|
||||
|
||||
For the full list of Android Studio releases with more details, visit the [Android Studio Releases List](android_studio_releases_list.md) page.
|
||||
|
||||
### Configuring the Plugin build.gradle File
|
||||
### Configuring the Plugin's Gradle Build Script
|
||||
|
||||
The use-case of developing for a non-IntelliJ IDEA IDE is reviewed in the [Plugins Targeting Alternate IntelliJ Platform-Based IDEs](gradle_guide.md#plugins-targeting-alternate-intellij-platform-based-ides) section of the [Configuring Gradle for IntelliJ Platform Plugins](gradle_guide.md) page.
|
||||
The particular example in that section discusses configuring a plugin project for PhpStorm, so the details for an Android Studio plugin project are reviewed here.
|
||||
|
||||
Here are the steps to configure the <path>build.gradle</path> file for developing a plugin to target Android Studio:
|
||||
Here are the steps to configure the Gradle build script for developing a plugin to target Android Studio:
|
||||
* The Gradle plugin attributes describing the configuration of the [IntelliJ Platform used to build the plugin project](gradle_guide.md#configuring-the-gradle-plugin-for-building-intellij-platform-plugin-projects) must be explicitly set.
|
||||
Continuing with the example [above](#matching-versions-of-the-intellij-platform-with-the-android-studio-version), set the `intellij.version` value to `191.8026.42`.
|
||||
Alternatively, specify `intellij.localPath` to refer to a local installation of Android Studio.
|
||||
* Android Studio plugin projects that use APIs from the `android` plugin must declare a dependency on that plugin.
|
||||
Declare the dependency in <path>build.gradle</path> using the Gradle plugin `intellij.plugins` attribute, which in this case lists the [directory name](https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties) of the plugin.
|
||||
Declare the dependency in the Gradle build script using the `intellij.plugins` attribute, which in this case lists the [directory name](https://github.com/JetBrains/gradle-intellij-plugin#intellij-platform-properties) of the plugin.
|
||||
* The best practice is to use the target version of Android Studio as the IDE Development Instance.
|
||||
Set the Development Instance to the (user-specific) absolute path to the target Android Studio application.
|
||||
|
||||
|
@ -21,7 +21,7 @@ Instead, configure AppCode plugin projects to use the `intellij.localPath` attri
|
||||
>
|
||||
{type="note"}
|
||||
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's <path>build.gradle</path> file.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's Gradle build script.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
|
||||
| `gradle-intellij-plugin` Attribute | Attribute Value |
|
||||
|
@ -17,7 +17,7 @@ Plugin projects for CLion can be developed using IntelliJ IDEA with the `gradle-
|
||||
|
||||
The configuration of CLion plugin projects follows the methods described in [Configuring Plugin Projects using a Product-Specific Attribute](dev_alternate_products.md#configuring-plugin-projects-using-a-product-specific-attribute), and [Configuring the plugin.xml File](dev_alternate_products.md#configuring-pluginxml).
|
||||
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's <path>build.gradle</path> file.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's Gradle build script.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
|
||||
| `gradle-intellij-plugin` Attribute | Attribute Value |
|
||||
|
@ -16,9 +16,9 @@ The configuration of DataGrip plugin projects follows the methods described in [
|
||||
>
|
||||
{type="note"}
|
||||
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's <path>build.gradle</path> file.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's Gradle build script.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
To see how these attributes appear in a similar <path>build.gradle</path> file for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
To see how these attributes appear in a similar Gradle build script for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
|
||||
| `gradle-intellij-plugin` Attribute | Attribute Value |
|
||||
|------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|
@ -22,8 +22,8 @@ All the Gradle configuration attributes described here are discussed in-depth on
|
||||
To create a new Gradle plugin project, follow the tutorial on the [](gradle_prerequisites.md) page.
|
||||
The tutorial produces a skeleton Gradle project suitable to use as a starting point.
|
||||
|
||||
Modifications are needed to the skeleton project's <path>build.gradle</path> and <path>plugin.xml</path> files, as described below, and on the individual product pages in Part VIII.
|
||||
The <path>build.gradle</path> file is modified to specify the target product, determining the APIs available during development.
|
||||
Modifications are needed to the skeleton project's Gradle build script and <path>plugin.xml</path> files, as described below, and on the individual product pages in Part VIII.
|
||||
The Gradle build script is modified to specify the target product, determining the APIs available during development.
|
||||
The <path>plugin.xml</path> file is modified to declare the plugin's dependency on modules or libraries.
|
||||
|
||||
## Configuring build.gradle to Target Products other than IntelliJ IDEA
|
||||
@ -47,7 +47,7 @@ Specifying the target as a product-specific `intellij.type` attribute has two ad
|
||||
(Unless additional plugin dependencies are specified.)
|
||||
* The default [Development Instance](ide_development_instance.md) for running the plugin will be the target product.
|
||||
|
||||
A <path>build.gradle</path> snippet setting a plugin project to target PyCharm is shown below.
|
||||
A Gradle build script snippet setting a plugin project to target PyCharm is shown below.
|
||||
The `gradle-intellij-plugin` will fetch the matching build of PyCharm Professional to define the APIs available, and use that build of PyCharm (and associated JetBrains runtime) as the Development Instance.
|
||||
No additional product-specific configuration needs to be set in the Gradle build script:
|
||||
|
||||
@ -76,8 +76,8 @@ intellij {
|
||||
|
||||
### Configuring Plugin Projects Using the IntelliJ IDEA Product Attribute
|
||||
|
||||
If the `gradle-intellij-plugin` does not directly support an IntelliJ Platform-based product, the <path>build.gradle</path> file can still be configured to target the desired product.
|
||||
In this case, the <path>build.gradle</path> file is configured to use IntelliJ IDEA (Community or Ultimate Edition) as the basis for the available APIs.
|
||||
If the `gradle-intellij-plugin` does not directly support an IntelliJ Platform-based product, the Gradle build script can still be configured to target the desired product.
|
||||
In this case, the build script is configured to use IntelliJ IDEA (Community or Ultimate Edition) as the basis for the available APIs.
|
||||
This does have the drawback that APIs not specific to the target product might accidentally be included in the plugin project.
|
||||
However, testing the plugin project in the target product helps to find such mistakes.
|
||||
|
||||
@ -112,7 +112,7 @@ The BRANCH and BUILD numbers match, therefore in this PhpStorm example:
|
||||
* The _targetIDE_ is PhpStorm, build `192.7142.41`,
|
||||
* The _baseIntelliJPlatformVersion_ (IntelliJ IDEA Community Edition) is build `192.7142.36`
|
||||
|
||||
This information is used to configure the plugin project's <path>build.gradle</path> and <path>plugin.xml</path> files.
|
||||
This information is used to configure the plugin project's Gradle build script and <path>plugin.xml</path> file.
|
||||
|
||||
#### Configuring build.gradle using the IntelliJ IDEA Product Attribute
|
||||
|
||||
|
@ -17,7 +17,7 @@ Plugin projects for GoLand can be developed using IntelliJ IDEA with the `gradle
|
||||
|
||||
The configuration of targeting GoLand IDE follows the methods described in [Configuring Plugin Projects Using a Product-Specific Attribute](dev_alternate_products.md#configuring-plugin-projects-using-a-product-specific-attribute).
|
||||
|
||||
Starting with 2020.2, it's possible to configure `GO` for `intellij.type` in <path>build.gradle</path>.
|
||||
Starting with 2020.2, it's possible to configure `GO` for `intellij.type` in the Gradle build script.
|
||||
|
||||
|
||||
```groovy
|
||||
@ -33,9 +33,9 @@ intellij {
|
||||
|
||||
The configuration of GoLand plugin projects follows the methods described in [Configuring Plugin Projects using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-plugin-projects-using-the-intellij-idea-product-attribute), and [Configuring the plugin.xml File](dev_alternate_products.md#configuring-pluginxml).
|
||||
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's <path>build.gradle</path> file.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's Gradle build script.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
To see how these attributes appear in a similar <path>build.gradle</path> file for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
To see how these attributes appear in a similar Gradle build script for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
|
||||
The Go plugin version is explicitly declared because it isn't bundled with IntelliJ IDEA Ultimate Edition.
|
||||
Select a [version](https://plugins.jetbrains.com/plugin/9568-go/versions) of the Go plugin compatible with the IntelliJ Idea Ultimate version.
|
||||
|
@ -20,9 +20,9 @@ The recommended best practice is to use PhpStorm for testing.
|
||||
Configuration of a Gradle-based PhpStorm plugin project is used as a tutorial in the section [Configuring Plugin Projects using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-plugin-projects-using-the-intellij-idea-product-attribute).
|
||||
Many techniques are discussed, such as choosing a version of IntelliJ IDEA Ultimate given a targeted version of PhpStorm.
|
||||
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's <path>build.gradle</path> file.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's Gradle build script.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
To see how these attributes appear in the <path>build.gradle</path> file for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
To see how these attributes appear in the Gradle build script for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
|
||||
| `gradle-intellij-plugin` Attribute | Attribute Value |
|
||||
|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|
@ -11,7 +11,7 @@ Plugin projects for PyCharm can be developed using IntelliJ IDEA with the `gradl
|
||||
|
||||
## Configuring Plugin Projects Targeting PyCharm
|
||||
The configuration of PyCharm plugin projects follows the methods described in [Configuring Plugin Projects using a Product-Specific Attribute](dev_alternate_products.md#configuring-plugin-projects-using-a-product-specific-attribute), and [Configuring the plugin.xml File](dev_alternate_products.md#configuring-pluginxml).
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the <path>build.gradle</path> file.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the Gradle build script.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
|
||||
| `gradle-intellij-plugin` Attribute | Attribute Value |
|
||||
|
@ -13,7 +13,7 @@ Rider uses the IntelliJ Platform to provide the user interface for a C# and .NET
|
||||
## IntelliJ IDEA Configuration for Rider Plugin Development
|
||||
|
||||
Although there is no dedicated Rider SDK, the [ReSharper DevGuide](https://www.jetbrains.com/help/resharper/sdk/Products/Rider.html) addresses the subject of plugins for Rider.
|
||||
The documentation describes the [configuration](https://www.jetbrains.com/help/resharper/sdk/Products/Rider.html#plugin-project-jvm) of <path>build.gradle</path> and <path>settings.gradle</path> files to build a Rider plugin using the [Gradle project system](gradle_build_system.md) in IntelliJ IDEA.
|
||||
The documentation describes the [configuration](https://www.jetbrains.com/help/resharper/sdk/Products/Rider.html#plugin-project-jvm) of the Gradle build script and <path>settings.gradle</path> file to build a Rider plugin using the [Gradle project system](gradle_build_system.md) in IntelliJ IDEA.
|
||||
|
||||
> See [](rider_extension_point_list.md) for the complete list.
|
||||
>
|
||||
|
@ -13,9 +13,9 @@ Plugin projects for RubyMine can be developed using IntelliJ IDEA with the `grad
|
||||
|
||||
The configuration of RubyMine plugin projects follows the methods described in [Configuring Plugin Projects using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-plugin-projects-using-the-intellij-idea-product-attribute), and [Configuring the plugin.xml File](dev_alternate_products.md#configuring-pluginxml).
|
||||
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the <path>build.gradle</path> file for a RubyMine plugin project.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the Gradle build script for a RubyMine plugin project.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
To see how these attributes appear in a similar <path>build.gradle</path> file for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
To see how these attributes appear in a similar Gradle build script for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
|
||||
| `gradle-intellij-plugin` Attribute | Attribute Value |
|
||||
|------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|
@ -16,9 +16,9 @@ Plugin projects for WebStorm can be developed using IntelliJ IDEA with the `grad
|
||||
## Configuring Plugin Projects Targeting WebStorm
|
||||
The configuration of WebStorm plugin projects follows the methods described in [Configuring Plugin Projects using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-plugin-projects-using-the-intellij-idea-product-attribute) and [Configuring the plugin.xml File](dev_alternate_products.md#configuring-pluginxml) for PhpStorm.
|
||||
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's <path>build.gradle</path> file.
|
||||
The table below summarizes the `gradle-intellij-plugin` attributes to set in the plugin project's Gradle build script.
|
||||
Click on an entry in the table's *Attribute* column to go to the documentation about that attribute.
|
||||
To see how these attributes appear in a similar <path>build.gradle</path> file for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
To see how these attributes appear in a similar Gradle build script for PhpStorm, see [Configuring build.gradle using the IntelliJ IDEA Product Attribute](dev_alternate_products.md#configuring-buildgradle-using-the-intellij-idea-product-attribute).
|
||||
|
||||
| `gradle-intellij-plugin` Attribute | Attribute Value |
|
||||
|------------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
|
||||
|
@ -6,7 +6,7 @@ This page provides a high-level overview of the *External System* sub-system.
|
||||
There are multiple project management systems ([Apache Maven](https://maven.apache.org/), [Gradle](https://www.gradle.org/), [sbt](https://www.scala-sbt.org/), etc.) and IntelliJ Platform provides a mechanism to support them in IDEs.
|
||||
|
||||
Most of the project management systems provide a similar set of facilities from the integration point of view:
|
||||
* build a project from external system config (<path>pom.xml</path>, <path>build.gradle</path>, etc.)
|
||||
* build a project from external system config (<path>pom.xml</path>, <path>build.gradle.kts</path>, etc.)
|
||||
* provide a list of available tasks
|
||||
* allow to execute a particular task
|
||||
* and more
|
||||
|
@ -17,15 +17,15 @@ See the [Maven coordinates](#specify-the-maven-coordinates-for-the-artifact) sec
|
||||
|
||||
Both the Releases and Snapshots repositories have two types of content:
|
||||
* Binary and source code artifacts for cross-platform, ZIP distributions of IntelliJ Platform-based IDEs, such as IntelliJ IDEA, CLion, Rider, and MPS.
|
||||
These artifacts are _not intended_ to be accessed directly from a plugin project's <path>build.gradle</path> file.
|
||||
These artifacts are _not intended_ to be accessed directly from a plugin project's Gradle build script.
|
||||
The `gradle-intellij-plugin` will access them as-needed for a plugin project.
|
||||
* Artifacts for individual modules from the IntelliJ Platform.
|
||||
These may be downloaded, or accessed directly from a <path>build.gradle</path> file, as explained below.
|
||||
These may be downloaded, or accessed directly from a Gradle build script, as explained below.
|
||||
|
||||
### Third-Party Dependencies
|
||||
|
||||
Artifacts for IntelliJ Platform third-party dependencies are hosted at a separate [intellij-dependencies](https://cache-redirector.jetbrains.com/intellij-dependencies) repository.
|
||||
A link to this repository should be added to <path>pom.xml</path>/<path>build.gradle</path> files when individual modules from an IntelliJ Platform artifacts repository are used.
|
||||
A link to this repository should be added to Maven POM or Gradle build script when individual modules from an IntelliJ Platform artifacts repository are used.
|
||||
|
||||
> Usages of deprecated URL `https://jetbrains.bintray.com/intellij-third-party-dependencies` must be replaced with `https://cache-redirector.jetbrains.com/intellij-dependencies` in build scripts.
|
||||
>
|
||||
@ -33,7 +33,7 @@ A link to this repository should be added to <path>pom.xml</path>/<path>build.gr
|
||||
|
||||
## Using IntelliJ Platform Module Artifacts
|
||||
|
||||
IntelliJ Platform module artifacts are utilized by adding information to a project's <path>build.gradle</path> file.
|
||||
IntelliJ Platform module artifacts are utilized by adding information to a project's Gradle build script.
|
||||
More information about [Gradle support](https://www.jetbrains.com/help/idea/gradle.html) is available in the IntelliJ IDEA Help documentation.
|
||||
|
||||
To set up dependencies on a module, there are two types of information needed:
|
||||
@ -94,7 +94,7 @@ For example, to specify the `jps-model-serialization` module:
|
||||
|
||||
## Gradle Example for an Individual Module from the IntelliJ Platform
|
||||
|
||||
This section presents an example of using a Gradle script to incorporate an IntelliJ Platform module and repository in a <path>build.gradle</path> file.
|
||||
This section presents an example of adding IntelliJ Platform repository and module in a Gradle build script.
|
||||
The example illustrates declaring the artifact URL, Maven coordinates, and version for the `jps-model-serialization` module artifact.
|
||||
There are two parts to the example: the repository and the dependency sections.
|
||||
|
||||
|
@ -24,5 +24,5 @@ Suppose the feature can potentially execute malicious code, and it is not obviou
|
||||
In that case, this feature has to be disabled in the safe mode, and enabling it has to be protected via a [confirmation](misc_swing_components.md#messages).
|
||||
|
||||
Samples:
|
||||
- It is not obvious that opening a folder in the IDE can execute <path>build.gradle</path>, which in turn can call a malicious code located inside the project => the Gradle import is disabled in the safe mode.
|
||||
- It is obvious that running or debugging the source code can execute malicious code => it is not necessary to wrap this action with a confirmation.
|
||||
* It is not obvious that opening a folder in the IDE can execute Gradle build script, which in turn can call a malicious code located inside the project => the Gradle import is disabled in the safe mode.
|
||||
* It is obvious that running or debugging the source code can execute malicious code => it is not necessary to wrap this action with a confirmation.
|
||||
|
@ -39,7 +39,7 @@ This section presents a guided tour of Gradle plugin attributes to achieve the c
|
||||
|
||||
By default, the Gradle plugin will build a plugin project against the IntelliJ Platform defined by the latest EAP snapshot of the IntelliJ IDEA Community Edition.
|
||||
|
||||
> Using EAP versions of the IntelliJ Platform requires adding the _Snapshots repository_ to the <path>build.gradle</path> file (see [IntelliJ Platform Artifacts Repositories](intellij_artifacts.md)).
|
||||
> Using EAP versions of the IntelliJ Platform requires adding the _Snapshots repository_ to the Gradle build script (see [IntelliJ Platform Artifacts Repositories](intellij_artifacts.md)).
|
||||
>
|
||||
{type="note"}
|
||||
|
||||
@ -100,20 +100,20 @@ As mentioned in the section about [configuring the IntelliJ Platform](#configuri
|
||||
Standardizing the versions of the Gradle plugin and Gradle system across projects will minimize the time spent downloading versions.
|
||||
|
||||
There are controls for managing the `gradle-intellij-plugin` version, and the version of Gradle itself.
|
||||
The plugin version is defined in the `plugins {}` section of a project's <path>build.gradle</path> file.
|
||||
The plugin version is defined in the `plugins {...}` section of a project's Gradle build script.
|
||||
The version of Gradle is defined in <path>$PROJECT_ROOT$/gradle/wrapper/gradle-wrapper.properties</path>.
|
||||
|
||||
### Patching the Plugin Configuration File
|
||||
|
||||
A plugin project's <path>plugin.xml</path> file has element values that are "patched" at build time from the attributes of the `patchPluginXml` task ([Patching DSL](https://github.com/JetBrains/gradle-intellij-plugin#patching-dsl)).
|
||||
As many as possible of the attributes in the Patching DSL will be substituted into the corresponding element values in a plugin project's <path>plugin.xml</path> file:
|
||||
* If a `patchPluginXml` attribute default value is defined, the attribute value will be patched in <path>plugin.xml</path> _regardless of whether the `patchPluginXml` task appears in the <path>build.gradle</path> file_.
|
||||
* If a `patchPluginXml` attribute default value is defined, the attribute value will be patched in <path>plugin.xml</path> _regardless of whether the `patchPluginXml` task appears in the Gradle build script_.
|
||||
* For example, the default values for the attributes `patchPluginXml.sinceBuild` and `patchPluginXml.untilBuild` are defined based on the declared (or default) value of `intellij.version`.
|
||||
So by default `patchPluginXml.sinceBuild` and `patchPluginXml.untilBuild` are substituted into the `<idea-version>` element's `since-build` and `until-build` attributes in the <path>plugin.xml</path> file.
|
||||
* If a `patchPluginXml` attribute value is explicitly defined, the attribute value will be substituted in <path>plugin.xml</path>.
|
||||
* If both `patchPluginXml.sinceBuild` and `patchPluginXml.untilBuild` attributes are explicitly set, both are substituted in <path>plugin.xml</path>.
|
||||
* If one attribute is explicitly set (e.g. `patchPluginXml.sinceBuild`) and one is not (e.g. `patchPluginXml.untilBuild` has a default value,) both attributes are patched at their respective (explicit and default) values.
|
||||
* For **no substitution** of the `<idea-version>` element's `since-build` and `until-build` attributes, one of the following must appear in the <path>build.gradle</path> file:
|
||||
* For **no substitution** of the `<idea-version>` element's `since-build` and `until-build` attributes, one of the following must appear in the Gradle build script:
|
||||
* Either set `intellij.updateSinceUntilBuild = false`, which will disable substituting both `since-build` and `until-build` attributes,
|
||||
|
||||
The best practice to avoid confusion is to replace the elements in <path>plugin.xml</path> that will be patched by the Gradle plugin with a comment.
|
||||
@ -129,7 +129,7 @@ As discussed in [Components of a Wizard-Generated Gradle IntelliJ Platform Plugi
|
||||
However, the `gradle-intellij-plugin` does not combine and substitute those Gradle properties for the default `<id>` and `<name>` elements in the <path>plugin.xml</path> file.
|
||||
|
||||
The best practice is to keep `project.version` current.
|
||||
By default, if you modify `project.version` in <path>build.gradle</path>, the Gradle plugin will automatically update the `<version>` value in the <path>plugin.xml</path> file.
|
||||
By default, if you modify `project.version` in Gradle build script, the Gradle plugin will automatically update the `<version>` value in the <path>plugin.xml</path> file.
|
||||
This practice keeps all version declarations synchronized.
|
||||
|
||||
### Verifying Plugin
|
||||
|
@ -56,12 +56,12 @@ Then click _Next_:
|
||||
### Project Naming/Artifact Coordinates Screen
|
||||
|
||||
Expand the <control>Artifact Coordinates</control> section and specify a [GroupId, ArtifactId, and Version](https://www.jetbrains.com/help/idea/gradle.html#project_create_gradle) using [Maven naming](https://maven.apache.org/guides/mini/guide-naming-conventions.html) conventions.
|
||||
* <control>GroupId</control> is typically a Java package name, and it is used for the Gradle property `project.group` value in the project's <path>build.gradle</path> file.
|
||||
* <control>GroupId</control> is typically a Java package name, and it is used for the Gradle property `project.group` value in the project's Gradle build script.
|
||||
For this example, enter `com.example.mycompany`.
|
||||
* <control>ArtifactId</control> is the default name of the project JAR file (without a version).
|
||||
It is also used for the Gradle property `rootProject.name` value in the project's <path>settings.gradle</path> file.
|
||||
For this example, enter `my_gradle_plugin`.
|
||||
* <control>Version</control> is used for the Gradle property `project.version` value in the <path>build.gradle</path> file.
|
||||
* <control>Version</control> is used for the Gradle property `project.version` value in the Gradle build script.
|
||||
For this example, enter `1.0`.
|
||||
|
||||
The <control>Name</control> field is synced automatically with the specified <control>ArtifactId</control>.
|
||||
|
@ -140,7 +140,7 @@ Implicit in using [`LocalInspectionTool`](upsource:///platform/analysis-api/src/
|
||||
|
||||
### Inspection Unit Test
|
||||
|
||||
> Please note that running the test requires setting system property `idea.home.path` in `test {}` block of <path>build.gradle</path>.
|
||||
> Please note that running the test requires setting system property `idea.home.path` in the `test` task configuration of the Gradle build script.
|
||||
>
|
||||
{type="note"}
|
||||
|
||||
|
@ -51,16 +51,16 @@ return (n>=0) ? n : -n;
|
||||
|
||||
```java
|
||||
if ((n>=0)) {
|
||||
return n;
|
||||
return n;
|
||||
} else {
|
||||
return -n;
|
||||
return -n;
|
||||
}
|
||||
```
|
||||
</compare>
|
||||
|
||||
#### Testing the Plugin
|
||||
|
||||
> Please note that running the test requires setting system property `idea.home.path` in `test {}` block of <path>build.gradle</path>
|
||||
> Please note that running the test requires setting system property `idea.home.path` in the `test` task configuration of the Gradle build script.
|
||||
>
|
||||
{type="note"}
|
||||
|
||||
|
@ -90,7 +90,7 @@ See the <path>build.gradle</path> from [kotlin_demo](https://github.com/JetBrain
|
||||
```
|
||||
{src="kotlin_demo/build.gradle"}
|
||||
|
||||
### Use Kotlin to Write Gradle Script
|
||||
### Use Kotlin for Gradle Build Scripts
|
||||
|
||||
Gradle also supports using Kotlin in build scripts: <path>build.gradle.kts</path>.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user