Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gradle.api.invocation
Interface Build

All Known Implementing Classes:
  DefaultBuild

    public 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(groovy.lang.Closure closure)` Adds a closure to be called immediately after a project is evaluated.
`void` | `beforeProject(groovy.lang.Closure closure)` Adds a closure to be called immediately before a project is evaluated.
`java.io.File` | `getGradleHomeDir()` Returns the Gradle home directory.
`java.io.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 `StartParameter` used to start this build.
`TaskExecutionGraph` | `getTaskGraph()` Returns the `TaskExecutionGraph` for this build.
`void` | `removeProjectEvaluationListener(ProjectEvaluationListener listener)` Removes the given listener from this build.

Method Detail

### getGradleVersion

    java.lang.String getGradleVersion()

  Returns the current Gradle version.

  Returns:
    The Gradle version. Never returns null.

### getGradleUserHomeDir

    java.io.File getGradleUserHomeDir()

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

  Returns:
    The user home directory. Never returns null.

### getGradleHomeDir

    java.io.File getGradleHomeDir()

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

  Returns:
    The home directory. Never returns null.

### getRootProject

    Project getRootProject()

  Returns the root project of this build.

  Returns:
    The root project. Never returns null.

### getTaskGraph

    TaskExecutionGraph getTaskGraph()

  Returns the `TaskExecutionGraph` for this build.

  Returns:
    The task graph. Never returns null.

### getStartParameter

    StartParameter getStartParameter()

  Returns the `StartParameter` used to start this build.

  Returns:
    The start parameter. Never returns null.

### getInternalRepository

    InternalRepository getInternalRepository()

  Returns the repository used to pass artifacts between projects in this build.

  Returns:
    The internal repository. Never returns null.

### addProjectEvaluationListener

    ProjectEvaluationListener addProjectEvaluationListener(ProjectEvaluationListener listener)

  Adds a listener to this build, to receive notifications as projects are evaluated.

  Parameters:
    `listener` - The listener to add. Does nothing if this listener has already been added.
  Returns:
    The added listener.

### removeProjectEvaluationListener

    void removeProjectEvaluationListener(ProjectEvaluationListener listener)

  Removes the given listener from this build.

  Parameters:
    `listener` - The listener to remove. Does nothing if this listener has not been added.

### beforeProject

    void beforeProject(groovy.lang.Closure closure)

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

  Parameters:
    `closure` - The closure to execute.

### afterProject

    void afterProject(groovy.lang.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.

  Parameters:
    `closure` - The closure to execute.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD