| API Documentation: | IdeaProject |
|---|
Enables fine-tuning project details (*.ipr file) of the IDEA plugin.
Example of use with a blend of all possible properties. Typically you don't have configure IDEA module directly because Gradle configures it for you.
import org.gradle.plugins.ide.idea.model.* apply plugin: 'java' apply plugin: 'idea' idea { project { //if you want to set specific jdk and language level jdkName = '1.6' languageLevel = '1.5' //you can update the source wildcards wildcards += '!?*.ruby' //you can configure the VCS used by the project vcs = 'Git' //you can change the modules of the *.ipr //modules = project(':someProject').idea.module //you can change the output file outputFile = new File(outputFile.parentFile, 'someBetterName.ipr') //you can add project-level libraries projectLibraries << new ProjectLibrary(name: "my-library", classes: [new File("path/to/library")]) } }
For tackling edge cases users can perform advanced configuration on resulting XML file. It is also possible to affect the way IDEA plugin merges the existing configuration via beforeMerged and whenMerged closures.
beforeMerged and whenMerged closures receive Project object
Examples of advanced configuration:
apply plugin: 'java' apply plugin: 'idea' idea { project { ipr { //you can tinker with the output *.ipr file before it's written out withXml { def node = it.asNode() node.appendNode('iLove', 'tinkering with the output *.ipr file!') } //closure executed after *.ipr content is loaded from existing file //but before gradle build information is merged beforeMerged { project -> //you can tinker with Project } //closure executed after *.ipr content is loaded from existing file //and after gradle build information is merged whenMerged { project -> //you can tinker with Project } } } }
| Property | Description |
ipr | |
jdkName | The java version used for defining the project sdk. |
languageLevel | The java language level of the project. Pass a valid Java version number (e.g. '1.5') or IDEA language level (e.g. 'JDK_1_5'). |
modules | A |
outputFile | Output *.ipr |
projectLibraries | Incubating The project-level libraries to be added to the IDEA project. |
vcs | Incubating The vcs for the project. |
wildcards | The wildcard resource patterns. |
| Block | Description |
ipr | Enables advanced configuration like tinkering with the output XML or affecting the way existing *.ipr content is merged with Gradle build information. |
XmlFileContentMerger ipr (read-only)
String jdkName
The java version used for defining the project sdk.
See the examples in the docs for IdeaProject
- Default with
ideaplugin: - Java version used to run Gradle, for example
'1.6' - Default with
ideaandjavaplugin: - Java version used to run Gradle, for example
'1.6'
IdeaLanguageLevel languageLevel
The java language level of the project. Pass a valid Java version number (e.g. '1.5') or IDEA language level (e.g. 'JDK_1_5').
See the examples in the docs for IdeaProject.
- Default with
ideaplugin: 'JDK_1_6'- Default with
ideaandjavaplugin: project.sourceCompatibility
List<IdeaModule> modules
List<IdeaModule>A ConventionProperty that holds modules for the ipr file.
See the examples in the docs for IdeaProject
- Default with
ideaplugin: project.allprojects.idea.module
File outputFile
Output *.ipr
See the examples in the docs for IdeaProject.
- Default with
ideaplugin: ${project.projectDir}/${project.name}.ipr
Set<ProjectLibrary> projectLibraries
Set<ProjectLibrary>Note: This property is incubating and may change in a future version of Gradle.
The project-level libraries to be added to the IDEA project.
- Default with
ideaplugin: []([scala-library]withscala-baseplugin)- Default with
ideaandjavaplugin: []([scala-library]withscala-baseplugin)
String vcs
Note: This property is incubating and may change in a future version of Gradle.
The vcs for the project.
Values are the same as used in IDEA's “Version Control” preference window (e.g. 'Git', 'Subversion').
See the examples in the docs for IdeaProject.
The wildcard resource patterns.
See the examples in the docs for IdeaProject.
- Default with
ideaplugin: ['!?*.java', '!?*.groovy']
Enables advanced configuration like tinkering with the output XML or affecting the way existing *.ipr content is merged with Gradle build information.
See the examples in the docs for IdeaProject
- Delegates to:
XmlFileContentMergerfromipr