This project contains a Gradle plugin that allows to control various aspects of IntelliJ configuration generated using Gradle's built-in idea plugin without requiring any knowledge of IntelliJ's config file structure or having to manipulate XML as well as a convention plugin which applies base IntelliJ project configuration.
This convention plugin applies base IntelliJ project configuration, namely to use Git as the VCS and dismiss Gradle project import popup. It also bootstraps a default remote debug run configuration and disables code and todo analysis when committing code.
For installation instructions please see this plugin's page on Gradle Plugin Portal.
This plugin is designed to be applied onto the root project and has no effect if applied to a subproject.
This plugin applies Idea configuration extensions plugin.
This plugin does not add any extensions.
This plugin does not add any tasks to the project.
To use this plugin run the idea
task from Gradle's built-in idea plugin which is transitively applied by this plugin.
This plugin allows to control various aspects of IntelliJ configuration generated using Gradle's built-in idea plugin without requiring any knowledge of IntelliJ's config file structure or having to manipulate XML.
For installation instructions please see this plugin's page on Gradle Plugin Portal.
This plugin is designed to be applied onto the root project and has no effect if applied to a subproject.
This plugin applies Gradle's built-in idea plugin and works by configuring the idea
extension of that plugin.
This plugin adds an extension called extended
to the idea
extension of Gradle's built-in idea plugin.
There are several nested configuration properties hanging off the extended
extension and they are described below.
It's possible to modify the default JUnit run configuration via the following properties of idea.extended.workspace.junit
:
Name | Type | Description |
---|---|---|
systemProperties |
Map<String, ?> |
Entries are transformed into system properties which are set on the default JUnit run configuration using "VM options" field. |
environment |
Map<String, ?> |
Entries are transformed into environment variables which are set on the default JUnit run configuration using "envs" tag. |
tasks |
Iterable<String> |
An iterable containing Gradle task names and/or paths in the project. If not empty, execution of the provided tasks will be added to the "Before launch section" of the default JUnit run configuration. |
Example usage:
idea {
extended {
workspace {
junit {
tasks = ['pluginUnderTestMetadata']
systemProperties = ['webdriver.chrome.driver': '/path/to/chromedriver']
environment = [TEST: 'true']
}
}
}
}
IntelliJ project component configurations can be added via the following methods of idea.extended.project.components
:
Signature | Description |
---|---|
void file(Object file) |
Appends contents of an xml file containing a single component node as the root element to children of the root element of the ipr file. If a component node with the same name already exists in the ipr file then it is replaced. Anything that can be passed to Project#file(Object) can be used as an argument. |
void stream(InputStream stream) |
Appends contents of an xml stream containing a single component node as the root element to children of the root element of the ipr file. If a component node with the same name already exists in the ipr file then it is replaced. |
Example usage:
idea {
extended {
project {
components {
file 'code-style.xml'
}
}
}
}
IntelliJ workspace component configurations can be added via the following methods of idea.extended.workspace.components
:
Signature | Description |
---|---|
void file(Object file) |
Appends contents of an xml file containing a single component node as the root element to children of the root element of the iws file. If a component node with the same name already exists in the iws file then it is replaced. Anything that can be passed to Project#file(Object) can be used as an argument. |
void stream(InputStream stream) |
Appends contents of an xml stream containing a single component node as the root element to children of the root element of the iws file. If a component node with the same name already exists in the ipr file then it is replaced. |
Example usage:
idea {
extended {
workspace {
components {
file 'vcs-manager-configuration.xml'
}
}
}
}
Intellij workspace properties as specified in the PropertiesComponent
component can be controlled via properties()
method of idea.extended.workspace
.
The method takes a single argument, a Map<String, String>
.
Example usage:
idea {
extended {
workspace {
properties('show.inlinked.gradle.project.popup': 'false')
}
}
}
This plugin does not add any tasks to the project.
To use this plugin run the idea
task from Gradle's built-in idea plugin which is applied by this plugin.
The project is setup to generate IntelliJ configuration files.
Simply run ./gradlew idea
and open the generated *.ipr
file in IntelliJ.
If you import the project into IntelliJ as described above then you can run integration tests even after changing the code without having to perform any manual steps. They are configured to run in an environment matching the one used when running them using Gradle on the command line.
The project contains some code verification tasks aside from tests so if you wish to run a build matching the one on CI then execute ./gradlew check
.