Java Code Examples for org.gradle.api.project#getSubprojects()

The following examples show how to use org.gradle.api.project#getSubprojects() . 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: TaskReportTask.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void generate(Project project) throws IOException {
    renderer.showDetail(isDetail());
    renderer.addDefaultTasks(project.getDefaultTasks());

    AggregateMultiProjectTaskReportModel aggregateModel = new AggregateMultiProjectTaskReportModel(!isDetail());
    TaskDetailsFactory taskDetailsFactory = new TaskDetailsFactory(project);

    SingleProjectTaskReportModel projectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
    projectTaskModel.build(getProjectTaskLister().listProjectTasks(project));
    aggregateModel.add(projectTaskModel);

    for (Project subproject : project.getSubprojects()) {
        SingleProjectTaskReportModel subprojectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
        subprojectTaskModel.build(getProjectTaskLister().listProjectTasks(subproject));
        aggregateModel.add(subprojectTaskModel);
    }

    aggregateModel.build();

    DefaultGroupTaskReportModel model = new DefaultGroupTaskReportModel();
    model.build(aggregateModel);

    for (String group : model.getGroups()) {
        renderer.startTaskGroup(group);
        for (TaskDetails task : model.getTasksForGroup(group)) {
            renderer.addTask(task);
            for (TaskDetails child : task.getChildren()) {
                renderer.addChildTask(child);
            }
        }
    }
    renderer.completeTasks();

    for (Rule rule : project.getTasks().getRules()) {
        renderer.addRule(rule);
    }
}
 
Example 2
Source File: BuildInvocationsBuilder.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void findTasks(Project project, Collection<String> tasks) {
    for (Project child : project.getSubprojects()) {
        findTasks(child, tasks);
    }
    for (Task task : project.getTasks()) {
        tasks.add(task.getName());
    }
}
 
Example 3
Source File: TaskReportTask.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void generate(Project project) throws IOException {
    renderer.showDetail(isDetail());
    renderer.addDefaultTasks(project.getDefaultTasks());

    AggregateMultiProjectTaskReportModel aggregateModel = new AggregateMultiProjectTaskReportModel(!isDetail());
    TaskDetailsFactory taskDetailsFactory = new TaskDetailsFactory(project);

    SingleProjectTaskReportModel projectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
    projectTaskModel.build(getProjectTaskLister().listProjectTasks(project));
    aggregateModel.add(projectTaskModel);

    for (Project subproject : project.getSubprojects()) {
        SingleProjectTaskReportModel subprojectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
        subprojectTaskModel.build(getProjectTaskLister().listProjectTasks(subproject));
        aggregateModel.add(subprojectTaskModel);
    }

    aggregateModel.build();

    DefaultGroupTaskReportModel model = new DefaultGroupTaskReportModel();
    model.build(aggregateModel);

    for (String group : model.getGroups()) {
        renderer.startTaskGroup(group);
        for (TaskDetails task : model.getTasksForGroup(group)) {
            renderer.addTask(task);
            for (TaskDetails child : task.getChildren()) {
                renderer.addChildTask(child);
            }
        }
    }
    renderer.completeTasks();

    for (Rule rule : project.getTasks().getRules()) {
        renderer.addRule(rule);
    }
}
 
Example 4
Source File: BuildInvocationsBuilder.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
private void findTasks(Project project, Collection<String> tasks) {
    for (Project child : project.getSubprojects()) {
        findTasks(child, tasks);
    }
    for (Task task : project.getTasks()) {
        tasks.add(task.getName());
    }
}
 
Example 5
Source File: AbstractMetricsPlugin.java    From gradle-metrics-plugin with Apache License 2.0 5 votes vote down vote up
private void configureProjectCollectors(Project project) {
    configureProjectCollectorAction.execute(project);
    for (Project subproject : project.getSubprojects()) {
        // perform task scan for subprojects after subproject evaluation
        subproject.afterEvaluate(configureProjectCollectorAction);
    }
}
 
Example 6
Source File: TaskReportTask.java    From pushfish-android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void generate(Project project) throws IOException {
    renderer.showDetail(isDetail());
    renderer.addDefaultTasks(project.getDefaultTasks());

    AggregateMultiProjectTaskReportModel aggregateModel = new AggregateMultiProjectTaskReportModel(!isDetail());
    TaskDetailsFactory taskDetailsFactory = new TaskDetailsFactory(project);

    SingleProjectTaskReportModel projectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
    ProjectInternal projectInternal = (ProjectInternal) project;
    TaskContainerInternal tasks = projectInternal.getTasks();
    tasks.actualize();
    projectTaskModel.build(Sets.union(tasks, projectInternal.getImplicitTasks()));
    aggregateModel.add(projectTaskModel);

    for (Project subproject : project.getSubprojects()) {
        SingleProjectTaskReportModel subprojectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
        ProjectInternal subprojectInternal = (ProjectInternal) subproject;
        TaskContainerInternal subprojectTasks = subprojectInternal.getTasks();
        subprojectTasks.actualize();
        subprojectTaskModel.build(subprojectTasks);
        aggregateModel.add(subprojectTaskModel);
    }

    aggregateModel.build();

    DefaultGroupTaskReportModel model = new DefaultGroupTaskReportModel();
    model.build(aggregateModel);

    for (String group : model.getGroups()) {
        renderer.startTaskGroup(group);
        for (TaskDetails task : model.getTasksForGroup(group)) {
            renderer.addTask(task);
            for (TaskDetails child : task.getChildren()) {
                renderer.addChildTask(child);
            }
        }
    }
    renderer.completeTasks();

    for (Rule rule : project.getTasks().getRules()) {
        renderer.addRule(rule);
    }
}
 
Example 7
Source File: TaskReportTask.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 4 votes vote down vote up
public void generate(Project project) throws IOException {
    renderer.showDetail(isDetail());
    renderer.addDefaultTasks(project.getDefaultTasks());

    AggregateMultiProjectTaskReportModel aggregateModel = new AggregateMultiProjectTaskReportModel(!isDetail());
    TaskDetailsFactory taskDetailsFactory = new TaskDetailsFactory(project);

    SingleProjectTaskReportModel projectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
    ProjectInternal projectInternal = (ProjectInternal) project;
    TaskContainerInternal tasks = projectInternal.getTasks();
    tasks.actualize();
    projectTaskModel.build(Sets.union(tasks, projectInternal.getImplicitTasks()));
    aggregateModel.add(projectTaskModel);

    for (Project subproject : project.getSubprojects()) {
        SingleProjectTaskReportModel subprojectTaskModel = new SingleProjectTaskReportModel(taskDetailsFactory);
        ProjectInternal subprojectInternal = (ProjectInternal) subproject;
        TaskContainerInternal subprojectTasks = subprojectInternal.getTasks();
        subprojectTasks.actualize();
        subprojectTaskModel.build(subprojectTasks);
        aggregateModel.add(subprojectTaskModel);
    }

    aggregateModel.build();

    DefaultGroupTaskReportModel model = new DefaultGroupTaskReportModel();
    model.build(aggregateModel);

    for (String group : model.getGroups()) {
        renderer.startTaskGroup(group);
        for (TaskDetails task : model.getTasksForGroup(group)) {
            renderer.addTask(task);
            for (TaskDetails child : task.getChildren()) {
                renderer.addChildTask(child);
            }
        }
    }
    renderer.completeTasks();

    for (Rule rule : project.getTasks().getRules()) {
        renderer.addRule(rule);
    }
}