Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Task inputs vs task sources

Tags:

gradle

Every Gradle task has property inputs of type TaskInputs that represents a collection of input files for a task. This is used mainly to recognize that task is up-to-date. However, some of the input files are also marked as source files - what does it mean? In other words, what is the difference between task input file and task source file?

like image 222
ghik Avatar asked Mar 21 '13 18:03

ghik


1 Answers

From the doc for TaskInput.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.

So it appears that source files are a subset of input files. Presumably, the task defines the "work" performed.

like image 121
Michael Easter Avatar answered Oct 14 '22 02:10

Michael Easter