Groovy Documentation

org.gradle.plugins.idea
[Groovy] Class IdeaProject

java.lang.Object
  org.gradle.api.internal.AbstractTask
      org.gradle.api.DefaultTask
          org.gradle.plugins.idea.IdeaProject

class IdeaProject
extends DefaultTask

Generates an IDEA project file.

Authors:
Hans Dockter


Property Summary
java.lang.String javaVersion

The java version used for defining the project sdk.

java.io.File outputFile

The ipr file

java.util.Set subprojects

The subprojects that should be mapped to modules in the ipr file.

java.util.Set wildcards

The wildcard resource patterns.

 
Constructor Summary
IdeaProject()

 
Method Summary
IdeaProject beforeConfigured(groovy.lang.Closure closure)

Adds a closure to be called after the existing ipr xml or the default xml has been parsed.

void updateXML()

IdeaProject whenConfigured(groovy.lang.Closure closure)

Adds a closure after the domain objects that model the customizable aspects of the ipr file are fully populated.

IdeaProject withXml(groovy.lang.Closure closure)

Adds a closure to be called when the IPR XML has been created.

IdeaProject withXml(Action action)

Adds an action to be called when the IPR XML has been created.

 

Property Detail

javaVersion

@Input
java.lang.String javaVersion
The java version used for defining the project sdk.


outputFile

@OutputFile
java.io.File outputFile
The ipr file


subprojects

java.util.Set subprojects
The subprojects that should be mapped to modules in the ipr file. The subprojects will only be mapped, if the Idea plugin has been applied to them.


wildcards

@Input
java.util.Set wildcards
The wildcard resource patterns. Must not be null.


 
Constructor Detail

IdeaProject

IdeaProject()


 
Method Detail

beforeConfigured

IdeaProject beforeConfigured(groovy.lang.Closure closure)
Adds a closure to be called after the existing ipr xml or the default xml has been parsed. The information of this xml is used to populate the domain objects that model the customizable aspects of the ipr file. The closure is called before the parameter of this task are added to the domain objects. This hook allows you to do a partial clean for example. You can delete all modules from the existing xml while keeping all the other parts. The closure gets an instance of Project which can be modified.
Parameters:
closure - The closure to execute when the existing or default ipr xml has been parsed.
Returns:
this


updateXML

@TaskAction
void updateXML()


whenConfigured

IdeaProject whenConfigured(groovy.lang.Closure closure)
Adds a closure after the domain objects that model the customizable aspects of the ipr file are fully populated. Those objects are populated with the content of the existing or default ipr xml and the arguments of this task. The closure gets an instance of Project which can be modified.
Parameters:
closure - The closure to execute after the Project object has been fully populated.
Returns:
this


withXml

IdeaProject withXml(groovy.lang.Closure closure)
Adds a closure to be called when the IPR XML has been created. The XML is passed to the closure as a parameter in form of a XmlProvider. The closure can modify the XML.
Parameters:
closure - The closure to execute when the IPR XML has been created.
Returns:
this


withXml

IdeaProject withXml(Action action)
Adds an action to be called when the IPR XML has been created. The XML is passed to the action as a parameter in form of a XmlProvider. The action can modify the XML.
Parameters:
closure - The action to execute when the IPR XML has been created.
Returns:
this


 

Groovy Documentation