# 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<in Task>)
abstract fun cacheIf(cachingEnabledReason: String, spec: Spec<in Task>)
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(@Nullable paths: Array<@Nullable Any>): TaskOutputFilePropertyBuilder
Registers some output directories for this task.
doNotCacheIf
Link copied to clipboard
abstract fun doNotCacheIf(cachingDisabledReason: String, spec: Spec<in Task>)
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(@Nullable paths: Array<@Nullable 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<in Task>)
Adds a predicate to determine whether previous outputs of this task can be reused.