api / org.gradle.api.tasks / TaskInputs

TaskInputs

interface TaskInputs : CompatibilityAdapterForTaskInputs

A TaskInputs represents the inputs for a task.

You can obtain a TaskInputs instance using org.gradle.api.Task#getInputs().

Functions

dir

abstract fun dir(dirPath: Any): TaskInputFilePropertyBuilder

Registers an input directory hierarchy. All files found under the given directory are treated as input files for this task.

file

abstract fun file(path: Any): TaskInputFilePropertyBuilder

Registers some input file for this task.

files

abstract fun files(vararg paths: Any): TaskInputFilePropertyBuilder

Registers some input files for this task.

getFiles

abstract fun getFiles(): FileCollection

Returns the input files of this task.

getHasInputs

abstract fun getHasInputs(): Boolean

Returns true if this task has declared the inputs that it consumes.

getHasSourceFiles

abstract fun getHasSourceFiles(): Boolean

Returns true if this task has declared that it accepts source files.

getProperties

abstract fun getProperties(): MutableMap<String, Any>

Returns the set of input properties for this task.

getSourceFiles

abstract fun getSourceFiles(): FileCollection

Returns the set of source files for this task. These are the subset of input files which the task actually does work on. A task is skipped if it has declared it accepts source files, and this collection is empty.

properties

abstract fun properties(properties: MutableMap<String, *>): TaskInputs

Registers a set of input properties for this task. See #property(String, Object) for details.

Note: do not use the return value to chain calls. Instead always use call via org.gradle.api.Task#getInputs().

property

abstract fun property(name: String, value: Any): TaskInputPropertyBuilder

Registers an input property for this task. This value is persisted when the task executes, and is compared against the property value for later invocations of the task, to determine if the task is up-to-date.

The given value for the property must be Serializable, so that it can be persisted. It should also provide a useful equals() method.

You can specify a closure or Callable as the value of the property. In which case, the closure or Callable is executed to determine the actual property value.

Inheritors

TaskInputFilePropertyBuilder

interface TaskInputFilePropertyBuilder : TaskFilePropertyBuilder, TaskInputs

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

TaskInputPropertyBuilder

interface TaskInputPropertyBuilder : TaskPropertyBuilder, TaskInputs

Describes an input property of a task.