gradle
8.4

# TaskOutputs

interface TaskOutputs(source)

A `TaskOutputs` represents the outputs of a task.

You can obtain a `TaskOutputs` instance using getOutputs.

## Functions

cacheIf
Link copied to clipboard
abstract fun cacheIf(spec: Spec<out Any>)
abstract fun cacheIf(cachingEnabledReason: String, spec: Spec<out Any>)
Cache the results of the task only if the given spec is satisfied.
dir
Link copied to clipboard
abstract fun dir(path: Any): TaskOutputFilePropertyBuilder
Registers an output directory for this task.
dirs
Link copied to clipboard
abstract fun dirs(paths: Array<Any>): TaskOutputFilePropertyBuilder
Registers some output directories for this task.
doNotCacheIf
Link copied to clipboard
abstract fun doNotCacheIf(cachingDisabledReason: String, spec: Spec<out Any>)
Disable caching the results of the task if the given spec is satisfied.
file
Link copied to clipboard
abstract fun file(path: Any): TaskOutputFilePropertyBuilder
Registers some output file for this task.
files
Link copied to clipboard
abstract fun files(paths: Array<Any>): TaskOutputFilePropertyBuilder
Registers some output files for this task.
getFiles
Link copied to clipboard
abstract fun getFiles(): FileCollection
Returns the output files of this task.
getHasOutput
Link copied to clipboard
abstract fun getHasOutput(): Boolean
Returns true if this task has declared any outputs.
upToDateWhen
Link copied to clipboard
abstract fun upToDateWhen(upToDateClosure: Closure)
abstract fun upToDateWhen(upToDateSpec: Spec<out Any>)
Adds a predicate to determine whether previous outputs of this task can be reused.