Java Code Examples for org.gradle.api.internal.project.ProjectInternal#getAllprojects()

The following examples show how to use org.gradle.api.internal.project.ProjectInternal#getAllprojects() . 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: BuildDashboardPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void apply(final ProjectInternal project) {
    project.getPlugins().apply(ReportingBasePlugin.class);

    final GenerateBuildDashboard buildDashboardTask = project.getTasks().create(BUILD_DASHBOARD_TASK_NAME, GenerateBuildDashboard.class);
    buildDashboardTask.setDescription("Generates a dashboard of all the reports produced by this build.");
    buildDashboardTask.setGroup("reporting");

    DirectoryReport htmlReport = buildDashboardTask.getReports().getHtml();
    ConventionMapping htmlReportConventionMapping = new DslObject(htmlReport).getConventionMapping();
    htmlReportConventionMapping.map("destination", new Callable<Object>() {
        public Object call() throws Exception {
            return project.getExtensions().getByType(ReportingExtension.class).file("buildDashboard");
        }
    });

    Action<Task> captureReportingTasks = new Action<Task>() {
        public void execute(Task task) {
            if (!(task instanceof Reporting)) {
                return;
            }

            Reporting reporting = (Reporting) task;

            buildDashboardTask.aggregate(reporting);

            if (!task.equals(buildDashboardTask)) {
                task.finalizedBy(buildDashboardTask);
            }
        }
    };

    for (Project aProject : project.getAllprojects()) {
        aProject.getTasks().all(captureReportingTasks);
    }
}
 
Example 2
Source File: BuildDashboardPlugin.java    From pushfish-android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void apply(final ProjectInternal project) {
    project.getPlugins().apply(ReportingBasePlugin.class);

    final GenerateBuildDashboard buildDashboardTask = project.getTasks().create(BUILD_DASHBOARD_TASK_NAME, GenerateBuildDashboard.class);

    DirectoryReport htmlReport = buildDashboardTask.getReports().getHtml();
    ConventionMapping htmlReportConventionMapping = new DslObject(htmlReport).getConventionMapping();
    htmlReportConventionMapping.map("destination", new Callable<Object>() {
        public Object call() throws Exception {
            return project.getExtensions().getByType(ReportingExtension.class).file("buildDashboard");
        }
    });

    Action<Task> captureReportingTasks = new Action<Task>() {
        public void execute(Task task) {
            if (!(task instanceof Reporting)) {
                return;
            }

            Reporting reporting = (Reporting) task;

            buildDashboardTask.aggregate(reporting);

            if (!task.equals(buildDashboardTask)) {
                task.finalizedBy(buildDashboardTask);
            }
        }
    };

    for (Project aProject : project.getAllprojects()) {
        aProject.getTasks().all(captureReportingTasks);
    }
}
 
Example 3
Source File: BuildDashboardPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void apply(final ProjectInternal project) {
    project.getPlugins().apply(ReportingBasePlugin.class);

    final GenerateBuildDashboard buildDashboardTask = project.getTasks().create(BUILD_DASHBOARD_TASK_NAME, GenerateBuildDashboard.class);
    buildDashboardTask.setDescription("Generates a dashboard of all the reports produced by this build.");
    buildDashboardTask.setGroup("reporting");

    DirectoryReport htmlReport = buildDashboardTask.getReports().getHtml();
    ConventionMapping htmlReportConventionMapping = new DslObject(htmlReport).getConventionMapping();
    htmlReportConventionMapping.map("destination", new Callable<Object>() {
        public Object call() throws Exception {
            return project.getExtensions().getByType(ReportingExtension.class).file("buildDashboard");
        }
    });

    Action<Task> captureReportingTasks = new Action<Task>() {
        public void execute(Task task) {
            if (!(task instanceof Reporting)) {
                return;
            }

            Reporting reporting = (Reporting) task;

            buildDashboardTask.aggregate(reporting);

            if (!task.equals(buildDashboardTask)) {
                task.finalizedBy(buildDashboardTask);
            }
        }
    };

    for (Project aProject : project.getAllprojects()) {
        aProject.getTasks().all(captureReportingTasks);
    }
}
 
Example 4
Source File: BuildDashboardPlugin.java    From Pushjet-Android with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void apply(final ProjectInternal project) {
    project.getPlugins().apply(ReportingBasePlugin.class);

    final GenerateBuildDashboard buildDashboardTask = project.getTasks().create(BUILD_DASHBOARD_TASK_NAME, GenerateBuildDashboard.class);

    DirectoryReport htmlReport = buildDashboardTask.getReports().getHtml();
    ConventionMapping htmlReportConventionMapping = new DslObject(htmlReport).getConventionMapping();
    htmlReportConventionMapping.map("destination", new Callable<Object>() {
        public Object call() throws Exception {
            return project.getExtensions().getByType(ReportingExtension.class).file("buildDashboard");
        }
    });

    Action<Task> captureReportingTasks = new Action<Task>() {
        public void execute(Task task) {
            if (!(task instanceof Reporting)) {
                return;
            }

            Reporting reporting = (Reporting) task;

            buildDashboardTask.aggregate(reporting);

            if (!task.equals(buildDashboardTask)) {
                task.finalizedBy(buildDashboardTask);
            }
        }
    };

    for (Project aProject : project.getAllprojects()) {
        aProject.getTasks().all(captureReportingTasks);
    }
}