public interface TaskInputs
A TaskInputs
represents the inputs for a task.
You can obtain a TaskInputs
instance using Task.getInputs()
.
Modifier and Type | Method | Description |
---|---|---|
TaskInputFilePropertyBuilder |
dir(Object dirPath) |
Registers an input directory hierarchy.
|
TaskInputFilePropertyBuilder |
file(Object path) |
Registers some input file for this task.
|
TaskInputFilePropertyBuilder |
files(Object... paths) |
Registers some input files for this task.
|
FileCollection |
getFiles() |
Returns the input files of this task.
|
boolean |
getHasInputs() |
Returns true if this task has declared the inputs that it consumes.
|
boolean |
getHasSourceFiles() |
Returns true if this task has declared that it accepts source files.
|
Map<String,Object> |
getProperties() |
Returns a map of input properties for this task.
|
FileCollection |
getSourceFiles() |
Returns the set of source files for this task.
|
TaskInputs |
properties(Map<String,?> properties) |
Registers a set of input properties for this task.
|
TaskInputPropertyBuilder |
property(String name,
Object value) |
Registers an input property for this task.
|
boolean getHasInputs()
FileCollection getFiles()
TaskInputFilePropertyBuilder files(Object... paths)
paths
- The input files. The given paths are evaluated as per Project.files(Object...)
.TaskInputFilePropertyBuilder file(Object path)
path
- The input file. The given path is evaluated as per Project.file(Object)
.TaskInputFilePropertyBuilder dir(Object dirPath)
An input directory hierarchy ignores empty directories by default. See TaskInputFilePropertyBuilder.ignoreEmptyDirectories()
.
dirPath
- The directory. The path is evaluated as per Project.file(Object)
.Map<String,Object> getProperties()
UnsupportedOperationException
being thrown.TaskInputPropertyBuilder property(String name, @Nullable Object value)
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 must be a simple value, like a String or Integer, or serializable. For complex values,
Gradle compares the serialized forms for detecting changes and the equals()
method is ignored.
If the value is not known when registering the input, a Provider
can be
passed instead. Gradle will then resolve the provider at the latest possible time in order to determine the actual
property value.
name
- The name of the property. Must not be null.value
- The value for the property. Can be null.TaskInputs properties(Map<String,?> properties)
property(String, Object)
for details.
Note: do not use the return value to chain calls.
Instead always use call via Task.getInputs()
.
properties
- The properties.boolean getHasSourceFiles()
FileCollection getSourceFiles()