api / org.gradle.api.tasks / TaskState

TaskState

interface TaskState

TaskState provides information about the execution state of a org.gradle.api.Task. You can obtain a TaskState instance by calling org.gradle.api.Task#getState().

Functions

getDidWork

abstract fun getDidWork(): Boolean

Checks if the task actually did any work. Even if a task executes, it may determine that it has nothing to do. For example, a compilation task may determine that source files have not changed since the last time a the task was run.

getExecuted

abstract fun getExecuted(): Boolean

Returns true if this task has been executed.

getFailure

abstract fun getFailure(): Throwable

Returns the exception describing the task failure, if any.

getNoSource

abstract fun getNoSource(): Boolean

Returns true if the execution of this task was skipped due to task inputs are empty.

getSkipMessage

abstract fun getSkipMessage(): String

Returns a message describing why the task was skipped.

getSkipped

abstract fun getSkipped(): Boolean

Returns true if the execution of this task was skipped for some reason.

getUpToDate

abstract fun getUpToDate(): Boolean

Returns true if the execution of this task was skipped because the task was up-to-date.

rethrowFailure

abstract fun rethrowFailure(): Unit

Throws the task failure, if any. Does nothing if the task did not fail.