public class DefaultTaskOutputs extends Object implements TaskOutputsInternal
| Constructor and Description |
|---|
DefaultTaskOutputs(FileResolver resolver,
TaskInternal task) |
| Modifier and Type | Method and Description |
|---|---|
TaskOutputs |
dir(Object path)
Registers an output directory for this task.
|
TaskOutputs |
file(Object path)
Registers some output file for this task.
|
TaskOutputs |
files(Object... paths)
Registers some output files for this task.
|
FileCollection |
getFiles()
Returns the output files of this task.
|
boolean |
getHasOutput()
Returns true if this task has declared any outputs.
|
FileCollection |
getPreviousFiles() |
Spec<? super TaskInternal> |
getUpToDateSpec() |
void |
setHistory(TaskExecutionHistory history) |
void |
upToDateWhen(Closure upToDateClosure)
Adds a predicate to determine whether the outputs of this task are up-to-date.
|
void |
upToDateWhen(Spec<? super Task> upToDateSpec)
Adds a predicate to determine whether the outputs of this task are up-to-date.
|
public DefaultTaskOutputs(FileResolver resolver, TaskInternal task)
public Spec<? super TaskInternal> getUpToDateSpec()
getUpToDateSpec in interface TaskOutputsInternalpublic void upToDateWhen(Closure upToDateClosure)
TaskOutputsAdds a predicate to determine whether the outputs of this task are up-to-date. The given closure is executed at task execution time. The closure is passed the task as a parameter. If the closure returns false, the task outputs are considered out-of-date and the task will be executed.
You can add multiple such predicates. The task outputs are considered out-of-date when any predicate returns false.
upToDateWhen in interface TaskOutputsupToDateClosure - The closure to use to determine whether the task outputs are up-to-date.public void upToDateWhen(Spec<? super Task> upToDateSpec)
TaskOutputsAdds a predicate to determine whether the outputs of this task are up-to-date. The given spec is evaluated at task execution time. If the spec returns false, the task outputs are considered out-of-date and the task will be executed.
You can add multiple such predicates. The task outputs are considered out-of-date when any predicate returns false.
upToDateWhen in interface TaskOutputsupToDateSpec - The spec to use to determine whether the task outputs are up-to-date.public boolean getHasOutput()
TaskOutputsgetHasOutput in interface TaskOutputspublic FileCollection getFiles()
TaskOutputsgetFiles in interface TaskOutputspublic TaskOutputs files(Object... paths)
TaskOutputsfiles in interface TaskOutputspaths - The output files. The given paths are evaluated as for Project.files(Object...).public TaskOutputs file(Object path)
TaskOutputsfile in interface TaskOutputspath - The output file. The given path is evaluated as for Project.file(Object).public TaskOutputs dir(Object path)
TaskOutputsdir in interface TaskOutputspath - The output directory. The given path is evaluated as for Project.file(Object).public FileCollection getPreviousFiles()
getPreviousFiles in interface TaskOutputsInternalpublic void setHistory(TaskExecutionHistory history)
setHistory in interface TaskOutputsInternalCopyright © 2013. All rights reserved