api / org.gradle.api.execution / TaskExecutionListener

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

Functions

afterExecute

abstract fun afterExecute(task: Task, state: TaskState): Unit

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.

beforeExecute

abstract fun beforeExecute(task: Task): Unit

This method is called immediately before a task is executed.

Inheritors

TaskExecutionAdapter

open class TaskExecutionAdapter : TaskExecutionListener

A TaskExecutionListener adapter class for receiving task execution events. The methods in this class are empty. This class exists as convenience for creating listener objects.