|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
public interface Gradle
Represents an invocation of Gradle.
You can obtain a Gradle instance by calling Project.getGradle.
Method Summary | |
---|---|
void
|
addBuildListener(BuildListener buildListener)
|
void
|
addListener(java.lang.Object listener)
Adds the given listener to this build. |
ProjectEvaluationListener
|
addProjectEvaluationListener(ProjectEvaluationListener listener)
Adds a listener to this build, to receive notifications as projects are evaluated. |
void
|
afterProject(groovy.lang.Closure closure)
Adds a closure to be called immediately after a project is evaluated. |
void
|
allprojects(Action action)
Adds an action to execute against all projects of this build. |
void
|
beforeProject(groovy.lang.Closure closure)
Adds a closure to be called immediately before a project is evaluated. |
void
|
buildFinished(groovy.lang.Closure closure)
Adds a closure to be called when the build is completed. |
void
|
buildStarted(groovy.lang.Closure closure)
Adds a closure to be called when the build is started. |
Gradle
|
getGradle()
Returns this Gradle instance. |
java.io.File
|
getGradleHomeDir()
|
java.io.File
|
getGradleUserHomeDir()
|
java.lang.String
|
getGradleVersion()
|
Gradle
|
getParent()
|
Project
|
getRootProject()
|
StartParameter
|
getStartParameter()
Returns the StartParameter used to start this build. |
TaskExecutionGraph
|
getTaskGraph()
|
void
|
projectsEvaluated(groovy.lang.Closure closure)
Adds a closure to be called when all projects for the build have been evaluated. |
void
|
projectsLoaded(groovy.lang.Closure closure)
Adds a closure to be called when the projects for the build have been created from the settings. |
void
|
removeListener(java.lang.Object listener)
Removes the given listener from this build. |
void
|
removeProjectEvaluationListener(ProjectEvaluationListener listener)
Removes the given listener from this build. |
void
|
rootProject(Action action)
Adds an action to execute against the root project of this build. |
void
|
settingsEvaluated(groovy.lang.Closure closure)
Adds a closure to be called when the build settings have been loaded and evaluated. |
void
|
useLogger(java.lang.Object logger)
Uses the given object as a logger. |
Method Detail |
---|
public void addBuildListener(BuildListener buildListener)
Adds a BuildListener to this Build instance. The listener is notified of events which occur during the execution of the build.
buildListener
- The listener to add.
public void addListener(java.lang.Object listener)
listener
- The listener to add. Does nothing if this listener has already been added.
public ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener)
listener
- The listener to add. Does nothing if this listener has already been added.
public void afterProject(groovy.lang.Closure closure)
closure
- The closure to execute.
public void allprojects(Action action)
action
- The action to execute.
public void beforeProject(groovy.lang.Closure closure)
closure
- The closure to execute.
public void buildFinished(groovy.lang.Closure closure)
closure
- The closure to execute.
public void buildStarted(groovy.lang.Closure closure)
closure
- The closure to execute.
public Gradle getGradle()
gradle.parent
can express your intent better than using
parent
. This property also allows you to access Gradle properties from a scope where the property
may be hidden, such as, for example, from a method or closure.
public java.io.File getGradleHomeDir()
Returns the Gradle home directory, if any. This directory is the directory containing the Gradle distribution executing this build.
public java.io.File getGradleUserHomeDir()
Returns the Gradle user home directory. This directory is used to cache downloaded resources.
public java.lang.String getGradleVersion()
Returns the current Gradle version.
public Gradle getParent()
Returns the parent build of this build, if any.
public Project getRootProject()
Returns the root project of this build.
public StartParameter getStartParameter()
public TaskExecutionGraph getTaskGraph()
Returns the TaskExecutionGraph for this build.
public void projectsEvaluated(groovy.lang.Closure closure)
closure
- The closure to execute.
public void projectsLoaded(groovy.lang.Closure closure)
An example of hooking into the projectsLoaded to configure buildscript classpath from the init script.
//init.gradle gradle.projectsLoaded { rootProject.buildscript { repositories { //... } dependencies { //... } } }
closure
- The closure to execute.
public void removeListener(java.lang.Object listener)
listener
- The listener to remove. Does nothing if this listener has not been added.
public void removeProjectEvaluationListener(ProjectEvaluationListener listener)
listener
- The listener to remove. Does nothing if this listener has not been added.
public void rootProject(Action action)
action
- The action to execute.
public void settingsEvaluated(groovy.lang.Closure closure)
closure
- The closure to execute.
public void useLogger(java.lang.Object logger)
logger
- The logger to use.
Groovy Documentation