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

## org.gradle.api.execution
[Java] Interface TaskExecutionListener

    public interface TaskExecutionListener

A `TaskExecutionListener` is notified of the execution of the tasks in a build.

You can add a `TaskExecutionListener` to a build using TaskExecutionGraph.addTaskExecutionListener

Method Summary
`void` | `afterExecute(Task task, TaskState state)` This method is call immediately after a task has been executed.
`void` | `beforeExecute(Task task)` This method is called immediately before a task is executed.

Method Detail

### afterExecute

    public void afterExecute(Task task, TaskState state)

  This method is call immediately after a task has been executed. It is always called, regardless of whether the task completed successfully, or failed with an exception.
  Parameters:
    `task` - The task which was executed. Never null.
    `state` - The task state. If the task failed with an exception, the exception is available in this state. Never null.

### beforeExecute

    public void beforeExecute(Task task)

  This method is called immediately before a task is executed.
  Parameters:
    `task` - The task about to be executed. Never null.

Gradle API 1.1-rc-1