api / org.gradle.api.tasks / TaskOutputFilePropertyBuilder

TaskOutputFilePropertyBuilder

interface TaskOutputFilePropertyBuilder : TaskFilePropertyBuilder, TaskOutputs

Describes an output property of a task that contains zero or more files.

Since
3.0

Functions

dir

abstract fun dir(path: Any): TaskOutputFilePropertyBuilder

Throws UnsupportedOperationException.

file

abstract fun file(path: Any): TaskOutputFilePropertyBuilder

Throws UnsupportedOperationException.

files

abstract fun files(vararg paths: Any): TaskOutputFilePropertyBuilder

Throws UnsupportedOperationException.

getFiles

abstract fun getFiles(): FileCollection

Throws UnsupportedOperationException.

getHasOutput

abstract fun getHasOutput(): Boolean

Throws UnsupportedOperationException.

optional

abstract fun optional(): TaskOutputFilePropertyBuilder

Marks a task property as optional. This means that a value does not have to be specified for the property, but any value specified must meet the validation constraints for the property.

abstract fun optional(optional: Boolean): TaskOutputFilePropertyBuilder

Sets whether the task property is optional. If the task property is optional, it means that a value does not have to be specified for the property, but any value specified must meet the validation constraints for the property.

upToDateWhen

abstract fun upToDateWhen(upToDateClosure: Closure<Any>): Unit
abstract fun upToDateWhen(upToDateSpec: Spec<in Task>): Unit

Throws UnsupportedOperationException.

withPropertyName

abstract fun withPropertyName(propertyName: String): TaskOutputFilePropertyBuilder

{@inheritDoc}

Inherited Functions

cacheIf

abstract fun cacheIf(spec: Spec<in Task>): Unit

Cache the results of the task only if the given spec is satisfied. If the spec is not satisfied, the results of the task will not be cached.

You may add multiple such predicates. The results of the task are not cached if any of the predicates return false, or if any of the predicates passed to #doNotCacheIf(String, Spec) returns true. If cacheIf() is not specified, the task will not be cached unless the @CacheableTask annotation is present on the task type.

Consider using #cacheIf(String, Spec) instead for also providing a reason for disabling caching.

abstract fun cacheIf(cachingEnabledReason: String, spec: Spec<in Task>): Unit

Cache the results of the task only if the given spec is satisfied. If the spec is not satisfied, the results of the task will not be cached.

You may add multiple such predicates. The results of the task are not cached if any of the predicates return false, or if any of the predicates passed to #doNotCacheIf(String, Spec) returns true. If cacheIf() is not specified, the task will not be cached unless the @CacheableTask annotation is present on the task type.

dirs

abstract fun dirs(vararg paths: Any): TaskOutputFilePropertyBuilder

Registers some output directories for this task.

When the given paths is a java.util.Map, then each output directory will be associated with an identity. For cacheable tasks this is a requirement. The keys of the map must be non-empty strings. The values of the map will be evaluated to individual directories as per org.gradle.api.Project#file(Object).

Otherwise the given directories will be evaluated as per org.gradle.api.Project#files(Object...), and task output caching will be disabled for the task.

doNotCacheIf

abstract fun doNotCacheIf(cachingDisabledReason: String, spec: Spec<in Task>): Unit

Disable caching the results of the task if the given spec is satisfied. The spec will be evaluated at task execution time, not during configuration.

As opposed to #cacheIf(String, Spec), this method never enables caching for a task, it can only be used to disable caching.

You may add multiple such predicates. The results of the task are not cached if any of the predicates return true, or if any of the predicates passed to #cacheIf(String, Spec) returns false.