use of org.gradle.plugins.ide.internal.tooling.model.DefaultBuildInvocations in project gradle by gradle.
the class BuildInvocationsBuilder method buildAll.
@Override
@SuppressWarnings("StringEquality")
public DefaultBuildInvocations buildAll(String modelName, Project project) {
if (!canBuild(modelName)) {
throw new GradleException("Unknown model name " + modelName);
}
DefaultProjectIdentifier projectIdentifier = getProjectIdentifier(project);
// construct task selectors
List<LaunchableGradleTaskSelector> selectors = Lists.newArrayList();
Map<String, LaunchableGradleTaskSelector> selectorsByName = Maps.newTreeMap(Ordering.natural());
Set<String> visibleTasks = Sets.newLinkedHashSet();
findTasks(project, selectorsByName, visibleTasks);
for (String selectorName : selectorsByName.keySet()) {
LaunchableGradleTaskSelector selector = selectorsByName.get(selectorName);
selectors.add(selector.setName(selectorName).setTaskName(selectorName).setProjectIdentifier(projectIdentifier).setDisplayName(selectorName + " in " + project + " and subprojects.").setPublic(visibleTasks.contains(selectorName)));
}
// construct project tasks
List<LaunchableGradleTask> projectTasks = tasks(project);
// construct build invocations from task selectors and project tasks
return new DefaultBuildInvocations().setSelectors(selectors).setTasks(projectTasks).setProjectIdentifier(projectIdentifier);
}
Aggregations