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

A task that generates and Idea ipr 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.

java.lang.String projectURL(java.io.File file)

Returns a relative URL to the given file in the standard URL format used by IDEA.

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.

 

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


projectURL

java.lang.String projectURL(java.io.File file)
Returns a relative URL to the given file in the standard URL format used by IDEA. The resulting URL is relative to the project output directory, using the $PROJECT_DIR$ macro.
Parameters:
file - The file to which the relative path should point.
Returns:
The relative URL as a String.


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 groovy.util.Node. The xml might be modified.
Parameters:
closure - The closure to execute when the ipr xml has been created.
Returns:
this


 

Groovy Documentation