# UntrackedTask

@Documented
@Retention(value = RetentionPolicy.RUNTIME)
@Target(value = [ElementType.TYPE])
annotation class UntrackedTask(source)

Attached to a task to declare that the task should be untracked.

If a task is untracked, then Gradle will not try to capture its state. That also means that Gradle does not do any optimizations for running the task. For example, such a task will always be out of date and never stored in or loaded from the build cache.

There can be different reasons for declaring a task as untracked, for example:

- Some input or output locations contain unreadable files like pipes where Gradle cannot track the content.
- The input or output is stored remotely, for example in a database, and its state cannot be tracked.
- Another tool like Git already takes care of keeping the state, so it doesn't make sense for Gradle to do additional bookkeeping.
- Prevent Gradle from trying to snapshot a potentially large amount of content if an output location is not exclusively owned by the build.

org.gradle.work.InputChanges cannot be used for untracked tasks, since incremental tasks need to track the state of their inputs and outputs for them to be correct.

#### Since

7.3

## Functions

annotationType
Link copied to clipboard
abstract fun annotationType(): Class<out Annotation>
because
Link copied to clipboard
abstract fun because(): String
Mandatory reason why the task is untracked.
equals
Link copied to clipboard
abstract fun equals(p: Any): Boolean
hashCode
Link copied to clipboard
abstract fun hashCode(): Int
toString
Link copied to clipboard
abstract fun toString(): String