use of org.gradle.execution.TaskSelection in project gradle by gradle.
the class CommandLineTaskParser method parseTasks.
public List<TaskSelection> parseTasks(TaskExecutionRequest taskExecutionRequest) {
List<TaskSelection> out = Lists.newArrayList();
List<String> remainingPaths = new LinkedList<String>(taskExecutionRequest.getArgs());
while (!remainingPaths.isEmpty()) {
String path = remainingPaths.remove(0);
TaskSelection selection = taskSelector.getSelection(taskExecutionRequest.getProjectPath(), taskExecutionRequest.getRootDir(), path);
Set<Task> tasks = selection.getTasks();
remainingPaths = taskConfigurer.configureTasks(tasks, remainingPaths);
out.add(selection);
}
return out;
}
use of org.gradle.execution.TaskSelection in project gradle by gradle.
the class Help method printTaskHelp.
private void printTaskHelp(StyledTextOutput output) {
TaskSelector selector = getTaskSelector();
TaskSelection selection = selector.getSelection(taskPath);
OptionReader optionReader = getOptionReader();
TaskDetailPrinter taskDetailPrinter = new TaskDetailPrinter(taskPath, selection, optionReader);
taskDetailPrinter.print(output);
}
use of org.gradle.execution.TaskSelection in project gradle by gradle.
the class TestExecutionBuildConfigurationAction method queryTestTasks.
private Set<Test> queryTestTasks(String testTaskPath) {
TaskSelection taskSelection;
try {
taskSelection = taskSelector.getSelection(testTaskPath);
} catch (TaskSelectionException e) {
throw new TestExecutionException(String.format("Requested test task with path '%s' cannot be found.", testTaskPath));
}
Set<Task> tasks = taskSelection.getTasks();
if (tasks.isEmpty()) {
throw new TestExecutionException(String.format("Requested test task with path '%s' cannot be found.", testTaskPath));
}
Set<Test> result = new LinkedHashSet<>();
for (Task task : tasks) {
if (!(task instanceof Test)) {
throw new TestExecutionException(String.format("Task '%s' of type '%s' not supported for executing tests via TestLauncher API.", testTaskPath, task.getClass().getName()));
}
result.add((Test) task);
}
return result;
}
Aggregations