use of org.gradle.foundation.TaskView in project gradle by gradle.
the class TaskTreePopulationVisitor method visitTasks.
/*
Add the list of tasks to the parent tree node.
*/
private static <P, T> List<T> visitTasks(Visitor<P, T> visitor, ProjectAndTaskFilter filter, ProjectView project, int startingIndex, P userProjectObject, Comparator<TaskView> taskSorter) {
List<T> taskObjects = new ArrayList<T>();
//make a copy because we're going to sort them
List<TaskView> tasks = CollectionUtils.sort(project.getTasks(), taskSorter);
Iterator<TaskView> iterator = tasks.iterator();
int index = startingIndex;
while (iterator.hasNext()) {
TaskView task = iterator.next();
if (filter.doesAllowTask(task)) {
T taskObject = visitor.visitTask(task, index, project, userProjectObject);
taskObjects.add(taskObject);
}
index++;
}
return taskObjects;
}
Aggregations