This project requires JVM version of at least 1.7
This plugin allows you to build plugins for IntelliJ platform using specific IntelliJ SDK and bundled plugins.
The plugin adds extra IntelliJ-specific dependencies, patches processResources tasks to fill some tags
(name, version) in plugin.xml
with appropriate values, patches compile tasks to instrument code with
nullability assertions and forms classes made with IntelliJ GUI Designer and provides some build steps which might be
helpful while developing plugins for IntelliJ platform.
plugins {
id "org.jetbrains.intellij" version "0.2.18"
}
Pre Gradle 2.1 - Use the following code when Gradle is not at version 2.1 or higher (Click to expand)...
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/"
}
}
dependencies {
classpath "gradle.plugin.org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.2.18"
}
}
apply plugin: 'org.jetbrains.intellij'
SNAPSHOT - Use the following code to get the lastest features (Click to expand)...
buildscript {
repositories {
mavenCentral()
maven {
url "https://oss.sonatype.org/content/repositories/snapshots/"
}
maven {
url 'http://dl.bintray.com/jetbrains/intellij-plugin-service'
}
}
dependencies {
classpath "org.jetbrains.intellij.plugins:gradle-intellij-plugin:0.3.0-SNAPSHOT"
}
}
apply plugin: 'org.jetbrains.intellij'
Plugin introduces the following tasks
Task | Description |
---|---|
buildPlugin |
Assembles plugin and prepares zip archive for deployment. |
patchPluginXml |
Collects all plugin.xml files in sources and fill since/until build and version attributes. |
prepareSandbox |
Creates proper structure of plugin, copies patched plugin xml files and fills sandbox directory with all of it. |
prepareTestingSandbox |
Prepares sandbox that will be used while running tests |
runIde |
Executes an IntelliJ IDEA instance with the plugin you are developing. |
publishPlugin |
Uploads plugin distribution archive to http://plugins.jetbrains.com. |
Available in SNAPSHOT:
Task | Description |
---|---|
verifyPlugin |
Validates plugin.xml and plugin's structure. |
Plugin provides following options to configure target IntelliJ SDK and build archive
The following attributes are apart of the Setup DSL intellij { ... } in which allows you to setup the environment and dependencies.
Attributes | Values |
---|---|
pluginName - The name of the target zip-archive and defines the name of plugin artifact. | Acceptable Values: String - 'gradle-intellij-plugin' Default Value: $project.name |
version - The version of the IDEA distribution that should be used as a dependency. Notes:
|
Acceptable Values:
|
type - The type of IDEA distribution. | Acceptable Values:
|
plugins -The list of bundled IDEA plugins and plugins from the IDEA repository. Notes:
|
Acceptable Values:
|
updateSinceUntilBuild - Should plugin patch plugin.xml with since and until build values? Notes:
|
Acceptable Values: true false Default Value: true |
sameSinceUntilBuild - Should plugin patch plugin.xml with an until build value that is just an "open" since build? Notes:
|
Acceptable Values: true false Default Value: false |
instrumentCode - Should plugin instrument java classes with nullability assertions? Notes:
|
Acceptable Values: true false Default Value: true |
downloadSources - Should plugin download IntelliJ sources while initializing Gradle build? Notes:
|
Acceptable Values: true false Default Value: true if CI environment variable is not set |
localPath - The path to locally installed IDEA distribution that should be used as a dependency. Notes:
|
Acceptable Values: path - '/Applications/IntelliJIDEA.app' Default Value: null |
sandboxDirectory - The path of sandbox directory that is used for running IDEA with developing plugin. | Acceptable Values: path - '${project.rootDir}/.sandbox' Default Value: '${project.buildDir}/idea-sandbox' |
alternativeIdePath - The absolute path to the locally installed JetBrains IDE. Notes:
|
Acceptable Values: path - '/Applications/Android Studio.app' Default Value: none |
ideaDependencyCachePath -The absolute path to the local directory that should be used for storing IDEA distributions. Notes:
|
Acceptable Values: path - '<example>' Default Value: none |
Deprecated Setup DSL Attributes
Attribute | Values |
---|---|
systemProperties - The map of system properties which will be passed to IDEA instance on executing runIdea task and tests. Notes:
|
Acceptable Values: Default Value: [] |
runIde
task extends JavaExec Gradle task,
all configuration attributes of JavaExec
task can be used in runIde
as well.
In addition to that, following attributes may be used to customize IDE running:
Attributes | Default Value |
---|---|
jbreVersion JetBrains Java version to use | Acceptable Values: String - 'jbrex8u112b752.4' All JetBrains Java version are available at BitTray. Default Value: null for IDEA < 2017.3, builtin java version for IDEA >= 2017.3 |
ideaDirectory Path to IDEA distribution | path to IDE-dependency |
configDirectory Path to configuration directory | ${intellij.sandboxDirectory}/config |
pluginsDirectory Path to plugins directory | ${intellij.sandboxDirectory}/plugins |
systemDirectory Path to indexes directory | ${intellij.sandboxDirectory}/system |
The following attributes are apart of the Patching DSL patchPluginXml { ... } in which allows Gradle to patch specific attributes in a set of plugin.xml
files.
Attributes | Default Value |
---|---|
version is a value for the <version> tag. |
project.version |
sinceBuild is for the since-build attribute of the <idea-version> tag. |
IntelliJIDEABuildNumber |
untilBuild is for the until-build attribute of the <idea-version> tag. |
IntelliJIDEABranch.* |
pluginDescription is for the <description> tag. |
none |
changeNotes is for the <change-notes> tag. |
none |
pluginXmlFiles is a collection of xml files to patch. | All plugin.xml files with <idea-plugin> |
destinationDir is a directory to store patched xml files. | '${project.buildDir}/patchedPluginXmlFiles' |
The following attributes are apart of the Publishing DSL publishPlugin { ... } in which allows Gradle to upload a working plugin to the JetBrain Plugin Repository.
Attributes | Default Value |
---|---|
username Login username | none |
password Login password | none |
channels List of channel names to upload plugin to. | [default] |
host URL host of a plugin repository. | http://plugins.jetbrains.com |
distributionFile Jar or Zip file of plugin to upload | output of buildPlugin task |
Deprecated Publishing DSL intellij.publish { ... } or intellij { publish { ... } }
Attributes | Default Value |
---|---|
username Login username | none |
password Login password | none |
channel A single channel name to upload plugin to. | default |
channels List of comma-separated channel names to upload plugin to. | default |
plugins {
id "org.jetbrains.intellij" version "0.2.18"
}
intellij {
version 'IC-2016.1'
plugins = ['coverage', 'org.intellij.plugins.markdown:8.5.0.20160208']
pluginName 'MyPlugin'
}
publishPlugin {
username 'zolotov'
password 'password'
channels 'nightly'
}
Here is the manual on how to start developing plugins for IntelliJ IDEA using Gradle.
As examples of using this plugin you can check out following projects:
- Go plugin and its TeamCity build configuration
- Erlang plugin and its TeamCity build configuration
- Rust plugin and its TeamCity build configuration
- AWS CloudFormation plugin and its TeamCity build configuration
- Bash plugin and its TeamCity build configuration
- Perl5 plugin and its Travis configuration file
- Bamboo Soy plugin and its Travis configuration file
- Android Drawable Importer plugin
- Android Material Design Icon Generator plugin
- AceJump plugin
- Uses the Gradle Kotlin DSL
- EmberJS plugin
- GCloud plugin
- HCL plugin
- Robot plugin
- TOML plugin
- SQLDelight Android Studio Plugin
- idear plugin
- Uses the Gradle Kotlin DSL
- Android WiFi ADB plugin
- SonarLint plugin
- IdeaVim plugin and its TeamCity build configuration
- Adb Idea is configured to build and run against stable, beta or preview (canary) releases of Android Studio
- Gerrit uses Travis CI inclusive automated publishing of releases to GitHub and JetBrains plugin repository (triggered by version tag creation)
- .ignore
- Minecraft Development and its TeamCity build configuration
- Uses the Gradle Kotlin DSL
- Mixes Java, Kotlin, and Groovy code
- Uses Grammar Kit
- Uses a Kotlin version not bundled with IntelliJ
- Mainframer Integration
- Uses the Gradle Kotlin DSL
- Fully written in kotlin
- Uses RxJava
- Unity 3D plugin for JetBrains Rider
Copyright 2018 org.jetbrains.intellij.plugins
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.