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.

doFirst

open fun doFirst(action: Action<in Task>): Task(source)

Adds the given Action to the beginning of this task's action list.

Return

the task object this method is applied to

Since

0.8

Parameters

action

The action to add


open fun doFirst(actionName: String, action: Action<in Task>): Task(source)

Adds the given Action to the beginning of this task's action list.

Return

the task object this method is applied to

Since

4.2

Parameters

actionName

An arbitrary string that is used for logging.

action

The action to add


open fun doFirst(action: Closure): Task(source)

Adds the given closure to the beginning of this task's action list. The closure is passed this task as a parameter when executed.

Return

This task.

Since

0.7

Parameters

action

The action closure to execute.