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.

TaskState

interface TaskState(source)

TaskState provides information about the execution state of a org.gradle.api.Task.

You can obtain a TaskState instance by calling getState.

Accessing the details of the task state is only meaningful after the task has been executed.

Since

0.9

Functions

Link copied to clipboard
abstract fun getDidWork(): Boolean
Checks if the task actually did any work.
Link copied to clipboard
abstract fun getExecuted(): Boolean
Returns true if this task has been executed.
Link copied to clipboard
@Nullable
abstract fun getFailure(): @Nullable Throwable
Returns the exception describing the task failure, if any.
Link copied to clipboard
abstract fun getNoSource(): Boolean
Returns true if the execution of this task was skipped due to task inputs are empty.
Link copied to clipboard
@Nullable
abstract fun getSkipMessage(): @Nullable String
Returns a message describing why the task was skipped.
Link copied to clipboard
abstract fun getSkipped(): Boolean
Returns true if the execution of this task was skipped for some reason.
Link copied to clipboard
abstract fun getUpToDate(): Boolean
Returns true if the execution of this task was skipped because the task was up-to-date.
Link copied to clipboard
abstract fun rethrowFailure()
Throws the task failure, if any.