<commit_before>[//]: # (title: Gradle IntelliJ Plugin)

<toc-settings depth="2" mode="tree" structure-elements="chapter"/>

<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->

The Gradle IntelliJ Plugin is a plugin for the Gradle build system to help configuring your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.

> Current Gradle IntelliJ Plugin version is ![GitHub Release](https://img.shields.io/github/release/jetbrains/gradle-intellij-plugin.svg?style=flat-square)
>
{type="note"}

This plugin allows you to build plugins for IntelliJ Platform using specified IntelliJ SDK and bundled or third-party plugins.

The plugin provides the functionalities like:
- adding extra IntelliJ-specific dependencies
- patching `processResources` tasks to fill some tags (name, version) in <path>[plugin.xml](plugin_configuration_file.md)</path> with appropriate values
- patching compile tasks to instrument code with nullability assertions and form classes made with IntelliJ GUI Designer
- additional build steps which might be helpful while developing plugins for IntelliJ platform

> Please see also [](tools_gradle_intellij_plugin_faq.md) and [](tools_gradle_intellij_plugin_examples.md).
>
> Before visiting the [Issue Tracker](https://github.com/JetBrains/gradle-intellij-plugin/issues), update both plugin and Gradle to the latest versions.
> Please see [CONTRIBUTING](https://github.com/JetBrains/gradle-intellij-plugin/blob/master/CONTRIBUTING.md) on how to submit feedback and contribute to this project.
>
{type="tip"}

## Usage
To enable this plugin in your Gradle-based project, register the plugin in the Gradle build script's `plugins` section:

<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">

```kotlin
plugins {
  id("org.jetbrains.intellij") version "..."
}
```

</tab>
<tab title="Groovy" group-key="groovy">

```groovy
plugins {
  id "org.jetbrains.intellij" version "..."
}
```

</tab>
</tabs>

When upgrading to `1.x` version, please make sure to follow the [migration guide](https://lp.jetbrains.com/gradle-intellij-plugin) to adjust your existing build script.

> <control>Gradle JVM</control> must be set to Java 11 in <path>Settings/Preferences | Build, Execution, Deployment | Build Tools | Gradle</path>.
>
{type="tip"}

> This project requires Gradle 6.7.1 or newer. However, it is highly recommended to always use the latest available Gradle version.
> Update it with:
> ```Bash
> ./gradlew wrapper --gradle-version=VERSION
> ```
>
> See also: [Gradle Installation](https://gradle.org/install/) guide.
{type="tip"}

### Snapshot Release
The Snapshot release is a pre-release version built nightly from the latest main branch – as it is built every day using the same version number, it's not recommended to use it for production builds.

For switching to the snapshot release, point Gradle to the dedicated snapshot repository by adding an entry to the Gradle settings file.

> The current Gradle IntelliJ Plugin Snapshot version is ![GitHub Snapshot Release](https://img.shields.io/nexus/s/org.jetbrains.intellij/org.jetbrains.intellij.gradle.plugin?server=https://oss.sonatype.org)
>
{type="note"}

<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">

`build.gradle.kts`
```kotlin
plugins {
    id("org.jetbrains.intellij") version "..."
}
```

`settings.gradle.kts`
```kotlin
pluginManagement {
    repositories {
        maven("https://oss.sonatype.org/content/repositories/snapshots/")
        gradlePluginPortal()
    }
}
```
</tab>
<tab title="Groovy" group-key="groovy">

`build.gradle`
```groovy
plugins {
    id "org.jetbrains.intellij" version "..."
}
```

`settings.gradle`
```groovy
pluginManagement {
    repositories {
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
        gradlePluginPortal()
    }
}
```

</tab>
</tabs>


## Configuration


### Build


### Test


### Publish


### IntelliJ Extension
{id="configuration-intellij-extension"}

After the Gradle IntelliJ Plugin is applied, the `intellij` extension can be used to configure the plugin and common settings of the provided tasks.

It is mandatory to specify at least the [`intellij.version`](#configuration-intellij-extension-version) property.

**Example:**


<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">

```kotlin
intellij {
    version.set("2022.1.1")
    type.set("IU")
    plugins.set(listOf("com.jetbrains.php:221.5787.21"))
}
```

</tab>
<tab title="Groovy" group-key="groovy">

```groovy
intellij {<commit_msg>tools_gradle_intellij_plugin.md: adjust verifyPluginConfiguration task to new structure<commit_after>[//]: # (title: Gradle IntelliJ Plugin)

<toc-settings depth="2" mode="tree" structure-elements="chapter"/>

<!-- Copyright 2000-2022 JetBrains s.r.o. and other contributors. Use of this source code is governed by the Apache 2.0 license that can be found in the LICENSE file. -->

The Gradle IntelliJ Plugin is a plugin for the Gradle build system to help configuring your environment for building, testing, verifying, and publishing plugins for IntelliJ-based IDEs.

> Current Gradle IntelliJ Plugin version is ![GitHub Release](https://img.shields.io/github/release/jetbrains/gradle-intellij-plugin.svg?style=flat-square)
>
{type="note"}

This plugin allows you to build plugins for IntelliJ Platform using specified IntelliJ SDK and bundled or third-party plugins.

The plugin provides the functionalities like:
- adding extra IntelliJ-specific dependencies
- patching `processResources` tasks to fill some tags (name, version) in <path>[plugin.xml](plugin_configuration_file.md)</path> with appropriate values
- patching compile tasks to instrument code with nullability assertions and form classes made with IntelliJ GUI Designer
- additional build steps which might be helpful while developing plugins for IntelliJ platform

> Please see also [](tools_gradle_intellij_plugin_faq.md) and [](tools_gradle_intellij_plugin_examples.md).
>
> Before visiting the [Issue Tracker](https://github.com/JetBrains/gradle-intellij-plugin/issues), update both plugin and Gradle to the latest versions.
> Please see [CONTRIBUTING](https://github.com/JetBrains/gradle-intellij-plugin/blob/master/CONTRIBUTING.md) on how to submit feedback and contribute to this project.
>
{type="tip"}

## Usage
To enable this plugin in your Gradle-based project, register the plugin in the Gradle build script's `plugins` section:

<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">

```kotlin
plugins {
  id("org.jetbrains.intellij") version "..."
}
```

</tab>
<tab title="Groovy" group-key="groovy">

```groovy
plugins {
  id "org.jetbrains.intellij" version "..."
}
```

</tab>
</tabs>

When upgrading to `1.x` version, please make sure to follow the [migration guide](https://lp.jetbrains.com/gradle-intellij-plugin) to adjust your existing build script.

> <control>Gradle JVM</control> must be set to Java 11 in <path>Settings/Preferences | Build, Execution, Deployment | Build Tools | Gradle</path>.
>
{type="tip"}

> This project requires Gradle 6.7.1 or newer. However, it is highly recommended to always use the latest available Gradle version.
> Update it with:
> ```Bash
> ./gradlew wrapper --gradle-version=VERSION
> ```
>
> See also: [Gradle Installation](https://gradle.org/install/) guide.
{type="tip"}

### Snapshot Release
The Snapshot release is a pre-release version built nightly from the latest main branch – as it is built every day using the same version number, it's not recommended to use it for production builds.

For switching to the snapshot release, point Gradle to the dedicated snapshot repository by adding an entry to the Gradle settings file.

> The current Gradle IntelliJ Plugin Snapshot version is ![GitHub Snapshot Release](https://img.shields.io/nexus/s/org.jetbrains.intellij/org.jetbrains.intellij.gradle.plugin?server=https://oss.sonatype.org)
>
{type="note"}

<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">

`build.gradle.kts`
```kotlin
plugins {
    id("org.jetbrains.intellij") version "..."
}
```

`settings.gradle.kts`
```kotlin
pluginManagement {
    repositories {
        maven("https://oss.sonatype.org/content/repositories/snapshots/")
        gradlePluginPortal()
    }
}
```
</tab>
<tab title="Groovy" group-key="groovy">

`build.gradle`
```groovy
plugins {
    id "org.jetbrains.intellij" version "..."
}
```

`settings.gradle`
```groovy
pluginManagement {
    repositories {
        maven {
            url 'https://oss.sonatype.org/content/repositories/snapshots/'
        }
        gradlePluginPortal()
    }
}
```

</tab>
</tabs>


## Configuration


[//]: # (### Build)


[//]: # (### Test)


[//]: # (### Publish)


### IntelliJ Extension
{id="configuration-intellij-extension"}

After the Gradle IntelliJ Plugin is applied, the `intellij` extension can be used to configure the plugin and common settings of the provided tasks.

It is mandatory to specify at least the [`intellij.version`](#configuration-intellij-extension-version) property.

**Example:**


<tabs group="languages">
<tab title="Kotlin" group-key="kotlin">

```kotlin
intellij {
    version.set("2022.1.1")
    type.set("IU")
    plugins.set(listOf("com.jetbrains.php:221.5787.21"))
}
```

</tab>
<tab title="Groovy" group-key="groovy">

```groovy
intellij {
{'fraction_non_alphanumeric': 0.1266329540665824, 'fraction_numerical': 0.0067425200168563, 'mean_word_length': 4.584117647058823, 'pattern_counts': {'":': 0, '<': 51, '<?xml version=': 0, '>': 87, 'https://': 18, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1091658', 'n_tokens_mistral': 3079, 'n_tokens_neox': 2837, 'n_words': 910}