api / org.gradle.api.execution / TaskExecutionGraph / afterTask

afterTask

abstract fun afterTask(closure: Closure<Any>): Unit

Adds a closure to be called immediately after a task has executed. The task is passed to the closure as the first parameter. A org.gradle.api.tasks.TaskState is passed as the second parameter. Both parameters are optional.

Parameters

closure - The closure to execute when a task has been executed

abstract fun afterTask(action: Action<Task>): Unit

Adds an action to be called immediately after a task has executed. The task is passed to the action as the first parameter.

Parameters

action - The action to execute when a task has been executed

Since
3.1