For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

beforeTask

abstract fun beforeTask(closure: Closure)(source)

Deprecated

This method is not supported when configuration caching is enabled.

Adds a closure to be called immediately before a task is executed. The task is passed to the closure as a parameter.

Since

0.7

Parameters

closure

The closure to execute when a task is about to be executed.


abstract fun beforeTask(action: Action<Task>)(source)

Deprecated

This method is not supported when configuration caching is enabled.

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

Since

3.1

Parameters

action

The action to execute when a task is about to be executed.