Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api.tasks
[Java] Interface TaskState

    public interface TaskState

`TaskState` provides information about the execution state of a Task. You can obtain a `TaskState` instance by calling Task.getState.

Method Summary
`boolean` | `getDidWork()` Checks if the task actually did any work.
`boolean` | `getExecuted()` Returns true if this task has been executed.
`java.lang.Throwable` | `getFailure()` Returns the exception describing the task failure, if any.
`java.lang.String` | `getSkipMessage()` Returns a message describing why the task was skipped.
`boolean` | `getSkipped()` Returns true if the execution of this task was skipped for some reason.
`void` | `rethrowFailure()` Throws the task failure, if any.

Method Detail

### getDidWork

    public boolean getDidWork()

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

  Returns:
    true if this task has been executed and did any work.

### getExecuted

    public boolean getExecuted()

  Returns true if this task has been executed.

  Returns:
    true if this task has been executed.

### getFailure

    public java.lang.Throwable getFailure()

  Returns the exception describing the task failure, if any.
  Returns:
    The exception, or null if the task did not fail.

### getSkipMessage

    public java.lang.String getSkipMessage()

  Returns a message describing why the task was skipped.
  Returns:
    the message. returns null if the task was not skipped.

### getSkipped

    public boolean getSkipped()

  Returns true if the execution of this task was skipped for some reason.
  Returns:
    true if this task has been executed and skipped.

### rethrowFailure

    public void rethrowFailure()

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

Groovy Documentation