Java Code Examples for org.gradle.tooling.model.GradleProject#getChildren()
The following examples show how to use
org.gradle.tooling.model.GradleProject#getChildren() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BuildInvocationsConverter.java From pushfish-android with BSD 2-Clause "Simplified" License | 6 votes |
private List<BasicGradleTaskSelector> buildRecursively(GradleProject project) { Multimap<String, String> aggregatedTasks = ArrayListMultimap.create(); for (GradleProject childProject : project.getChildren()) { List<BasicGradleTaskSelector> childSelectors = buildRecursively(childProject); for (BasicGradleTaskSelector childSelector : childSelectors) { aggregatedTasks.putAll(childSelector.getName(), childSelector.getTaskNames()); } } for (GradleTask task : project.getTasks()) { aggregatedTasks.put(task.getName(), task.getPath()); } List<BasicGradleTaskSelector> selectors = Lists.newArrayList(); for (String selectorName : aggregatedTasks.keySet()) { SortedSet<String> selectorTasks = Sets.newTreeSet(new TaskNameComparator()); selectorTasks.addAll(aggregatedTasks.get(selectorName)); selectors.add(new BasicGradleTaskSelector(). setName(selectorName). setTaskNames(selectorTasks). setDescription(project.getParent() != null ? String.format("%s:%s task selector", project.getPath(), selectorName) : String.format("%s task selector", selectorName)). setDisplayName(String.format("%s in %s and subprojects.", selectorName, project.getName()))); } return selectors; }
Example 2
Source File: BuildInvocationsConverter.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 6 votes |
private List<BasicGradleTaskSelector> buildRecursively(GradleProject project) { Multimap<String, String> aggregatedTasks = ArrayListMultimap.create(); for (GradleProject childProject : project.getChildren()) { List<BasicGradleTaskSelector> childSelectors = buildRecursively(childProject); for (BasicGradleTaskSelector childSelector : childSelectors) { aggregatedTasks.putAll(childSelector.getName(), childSelector.getTaskNames()); } } for (GradleTask task : project.getTasks()) { aggregatedTasks.put(task.getName(), task.getPath()); } List<BasicGradleTaskSelector> selectors = Lists.newArrayList(); for (String selectorName : aggregatedTasks.keySet()) { SortedSet<String> selectorTasks = Sets.newTreeSet(new TaskNameComparator()); selectorTasks.addAll(aggregatedTasks.get(selectorName)); selectors.add(new BasicGradleTaskSelector(). setName(selectorName). setTaskNames(selectorTasks). setDescription(project.getParent() != null ? String.format("%s:%s task selector", project.getPath(), selectorName) : String.format("%s task selector", selectorName)). setDisplayName(String.format("%s in %s and subprojects.", selectorName, project.getName()))); } return selectors; }
Example 3
Source File: BuildInvocationsConverter.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void collectTasks(GradleProject project, Multimap<String, String> aggregatedTasks) { for (GradleProject childProject : project.getChildren()) { collectTasks(childProject, aggregatedTasks); } for (GradleTask task : project.getTasks()) { aggregatedTasks.put(task.getName(), task.getPath()); } }
Example 4
Source File: GradleBuildConverter.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void convertChildren(DefaultGradleBuild gradleBuild, PartialBasicGradleProject rootProject, GradleProject project) { final List<? extends GradleProject> childProjects = new ArrayList<GradleProject>(project.getChildren()); Collections.sort(childProjects, new Comparator<GradleProject>() { public int compare(GradleProject gp1, GradleProject gp2) { return gp1.getName().compareTo(gp2.getName()); } }); for (GradleProject childProject : childProjects) { PartialBasicGradleProject basicGradleProject = toPartialGradleProject(childProject); gradleBuild.addProject(basicGradleProject); basicGradleProject.setParent(rootProject); rootProject.addChild(basicGradleProject); convertChildren(gradleBuild, basicGradleProject, childProject); } }
Example 5
Source File: GradleBuildConverter.java From pushfish-android with BSD 2-Clause "Simplified" License | 5 votes |
private void convertChildren(DefaultGradleBuild gradleBuild, PartialBasicGradleProject rootProject, GradleProject project) { final List<? extends GradleProject> childProjects = new ArrayList<GradleProject>(project.getChildren()); Collections.sort(childProjects, new Comparator<GradleProject>() { public int compare(GradleProject gp1, GradleProject gp2) { return gp1.getName().compareTo(gp2.getName()); } }); for (GradleProject childProject : childProjects) { PartialBasicGradleProject basicGradleProject = toPartialGradleProject(childProject); gradleBuild.addProject(basicGradleProject); basicGradleProject.setParent(rootProject); rootProject.addChild(basicGradleProject); convertChildren(gradleBuild, basicGradleProject, childProject); } }
Example 6
Source File: BuildInvocationsConverter.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private void collectTasks(GradleProject project, Multimap<String, String> aggregatedTasks) { for (GradleProject childProject : project.getChildren()) { collectTasks(childProject, aggregatedTasks); } for (GradleTask task : project.getTasks()) { aggregatedTasks.put(task.getName(), task.getPath()); } }
Example 7
Source File: GradleBuildConverter.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private void convertChildren(DefaultGradleBuild gradleBuild, PartialBasicGradleProject rootProject, GradleProject project) { final List<? extends GradleProject> childProjects = new ArrayList<GradleProject>(project.getChildren()); Collections.sort(childProjects, new Comparator<GradleProject>() { public int compare(GradleProject gp1, GradleProject gp2) { return gp1.getName().compareTo(gp2.getName()); } }); for (GradleProject childProject : childProjects) { PartialBasicGradleProject basicGradleProject = toPartialGradleProject(childProject); gradleBuild.addProject(basicGradleProject); basicGradleProject.setParent(rootProject); rootProject.addChild(basicGradleProject); convertChildren(gradleBuild, basicGradleProject, childProject); } }
Example 8
Source File: GradleBuildConverter.java From Pushjet-Android with BSD 2-Clause "Simplified" License | 5 votes |
private void convertChildren(DefaultGradleBuild gradleBuild, PartialBasicGradleProject rootProject, GradleProject project) { final List<? extends GradleProject> childProjects = new ArrayList<GradleProject>(project.getChildren()); Collections.sort(childProjects, new Comparator<GradleProject>() { public int compare(GradleProject gp1, GradleProject gp2) { return gp1.getName().compareTo(gp2.getName()); } }); for (GradleProject childProject : childProjects) { PartialBasicGradleProject basicGradleProject = toPartialGradleProject(childProject); gradleBuild.addProject(basicGradleProject); basicGradleProject.setParent(rootProject); rootProject.addChild(basicGradleProject); convertChildren(gradleBuild, basicGradleProject, childProject); } }