-
public interface TaskInputsA
TaskInputsrepresents the inputs for a task.You can obtain a
TaskInputsinstance usingTask.getInputs().
-
-
Method Summary
Methods Modifier and Type Method and Description TaskInputsdir(Object dirPath)Registers an input directory hierarchy.
TaskInputsfile(Object path)Registers some input file for this task.
TaskInputsfiles(Object... paths)Registers some input files for this task.
FileCollectiongetFiles()Returns the input files of this task.
booleangetHasInputs()Returns true if this task has declared the inputs that it consumes.
booleangetHasSourceFiles()Returns true if this task has declared that it accepts source files.
Map<String,Object>getProperties()Returns the set of input properties for this task.
FileCollectiongetSourceFiles()Returns the set of source files for this task.
TaskInputsproperties(Map<String,?> properties)Registers a set of input properties for this task.
TaskInputsproperty(String name, Object value)Registers an input property for this task.
TaskInputssource(Object... paths)Registers some source files for this task.
TaskInputssource(Object path)Registers some source files for this task.
TaskInputssourceDir(Object path)Registers a source directory for this task.
-
-
-
Method Detail
-
getHasInputs
boolean getHasInputs()
Returns true if this task has declared the inputs that it consumes.
- Returns:
- true if this task has declared any inputs.
-
getFiles
FileCollection getFiles()
Returns the input files of this task.
- Returns:
- The input files. Returns an empty collection if this task has no input files.
-
files
TaskInputs files(Object... paths)
Registers some input files for this task.
- Parameters:
paths- The input files. The given paths are evaluated as perProject.files(Object...).- Returns:
- this
-
file
TaskInputs file(Object path)
Registers some input file for this task.
- Parameters:
path- The input file. The given path is evaluated as perProject.files(Object...).- Returns:
- this
-
dir
TaskInputs dir(Object dirPath)
Registers an input directory hierarchy. All files found under the given directory are treated as input files for this task.
- Parameters:
dirPath- The directory. The path is evaluated as perProject.file(Object).- Returns:
- this
-
getProperties
Map<String,Object> getProperties()
Returns the set of input properties for this task.
- Returns:
- The properties.
-
property
TaskInputs property(String name, 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 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
Callableas the value of the property. In which case, the closure orCallableis executed to determine the actual property value.- Parameters:
name- The name of the property. Must not be null.value- The value for the property. Can be null.
-
properties
TaskInputs properties(Map<String,?> properties)
- Parameters:
properties- The properties.
-
getHasSourceFiles
boolean getHasSourceFiles()
Returns true if this task has declared that it accepts source files.
- Returns:
- true if this task has source files, false if not.
-
getSourceFiles
FileCollection getSourceFiles()
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.
- Returns:
- The set of source files for this task.
-
source
TaskInputs source(Object... paths)
Registers some source files for this task. Note that source files are also considered input files, so calling this method implies a call to
files(Object...).- Parameters:
paths- The paths. These are evaluated as perProject.files(Object...).- Returns:
- this
-
source
TaskInputs source(Object path)
Registers some source files for this task. Note that source files are also considered input files, so calling this method implies a call to
files(Object...).- Parameters:
path- The path. This is evaluated as perProject.files(Object...).- Returns:
- this
-
sourceDir
TaskInputs sourceDir(Object path)
Registers a source directory for this task. All files under this directory are treated as source files for this task. Note that source files are also considered input files, so calling this method implies a call to
dir(Object).- Parameters:
path- The path. This is evaluated as perProject.file(Object).- Returns:
- this
-
-