Groovy Documentation

org.gradle.api.execution
Interface TaskExecutionListener


interface TaskExecutionListener

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

You can add a TaskExecutionListener to a build using org.gradle.api.execution.TaskExecutionGraph#addTaskExecutionListener


Method Summary
void afterExecute(Task task, java.lang.Throwable failure)

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, java.lang.Throwable failure)
This method is call immediately after a task has been executed. It is called whether the task completed successfully, or failed with an exception.
param:
task The task which was executed. Never null.
param:
failure The exception which was thrown by the task, if any. Null if the task completed successfully.


beforeExecute

public void beforeExecute(Task task)
This method is called immediately before a task is executed.
param:
task The task about to be executed. Never null.


 

Groovy Documentation