Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api.invocation
Interface Build

    interface Build

A `Build` represents an invocation of Gradle.

You can obtain a `Build` instance by calling Project#getBuild(). In your build file you can use `build` to access it.

Method Summary
`ProjectEvaluationListener` | `addProjectEvaluationListener(ProjectEvaluationListener listener)` Adds a listener to this build, to receive notifications as projects are evaluated.
`void` | `afterProject(Closure closure)` Adds a closure to be called immediately after a project is evaluated.
`void` | `beforeProject(Closure closure)` Adds a closure to be called immediately before a project is evaluated.
`File` | `getGradleHomeDir()` Returns the Gradle home directory.
`File` | `getGradleUserHomeDir()` Returns the Gradle user home directory.
`java.lang.String` | `getGradleVersion()` Returns the current Gradle version.
`InternalRepository` | `getInternalRepository()` Returns the repository used to pass artifacts between projects in this build.
`Project` | `getRootProject()` Returns the root project of this build.
`StartParameter` | `getStartParameter()` Returns the {
`TaskExecutionGraph` | `getTaskGraph()` Returns the {
`void` | `removeProjectEvaluationListener(ProjectEvaluationListener listener)` Removes the given listener from this build.

Method Detail

### addProjectEvaluationListener

    public ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener)

  Adds a listener to this build, to receive notifications as projects are evaluated.
  param:
    listener The listener to add. Does nothing if this listener has already been added.
  return:
    The added listener.

### afterProject

    public void afterProject(Closure closure)

  Adds a closure to be called immediately after a project is evaluated. The project is passed to the closure as the first parameter. The project evaluation failure, if any, is passed as the second parameter. Both parameters are options.
  param:
    closure The closure to execute.

### beforeProject

    public void beforeProject(Closure closure)

  Adds a closure to be called immediately before a project is evaluated. The project is passed to the closure as a parameter.
  param:
    closure The closure to execute.

### getGradleHomeDir

    public File getGradleHomeDir()

  Returns the Gradle home directory. This directory is used to locate resources such as the default imports file.

  return:
    The home directory. Never returns null.

### getGradleUserHomeDir

    public File getGradleUserHomeDir()

  Returns the Gradle user home directory. This directory is used to cache downloaded resources.

  return:
    The user home directory. Never returns null.

### getGradleVersion

    public java.lang.String getGradleVersion()

  Returns the current Gradle version.

  return:
    The Gradle version. Never returns null.

### getInternalRepository

    public InternalRepository getInternalRepository()

  Returns the repository used to pass artifacts between projects in this build.
  return:
    The internal repository. Never returns null.

### getRootProject

    public Project getRootProject()

  Returns the root project of this build.

  return:
    The root project. Never returns null.

### getStartParameter

    public StartParameter getStartParameter()

  Returns the StartParameter used to start this build.
  return:
    The start parameter. Never returns null.

### getTaskGraph

    public TaskExecutionGraph getTaskGraph()

  Returns the TaskExecutionGraph for this build.

  return:
    The task graph. Never returns null.

### removeProjectEvaluationListener

    public void removeProjectEvaluationListener(ProjectEvaluationListener listener)

  Removes the given listener from this build.
  param:
    listener The listener to remove. Does nothing if this listener has not been added.

Groovy Documentation