# TaskExecutionListener

interface TaskExecutionListener(source)

### Deprecated

This type is not supported when configuration caching is enabled.

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

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

This listener type is not supported when the configuration cache is enabled. To receive task completion events in a compatible way, use a BuildService that implements org.gradle.tooling.events.OperationCompletionListener and register it via org.gradle.build.event.BuildEventsListenerRegistry.

#### Since

0.7

#### Inheritors

TaskExecutionAdapter

## Functions

afterExecute
Link copied to clipboard
abstract fun afterExecute(task: Task, state: TaskState)
This method is called immediately after a task has been executed.
beforeExecute
Link copied to clipboard
abstract fun beforeExecute(task: Task)
This method is called immediately before a task is executed.