Search in sources :

Example 1 with SomeToolingModel

use of org.gradle.configurationcache.fixtures.SomeToolingModel in project gradle by gradle.

the class FetchCustomModelForEachProjectInTree method execute.

@Override
public List<SomeToolingModel> execute(BuildController controller) {
    List<SomeToolingModel> result = new ArrayList<>();
    GradleBuild buildModel = controller.getBuildModel();
    collectModelsForProjects(controller, result, buildModel);
    for (GradleBuild build : buildModel.getEditableBuilds()) {
        collectModelsForProjects(controller, result, build);
    }
    return result;
}
Also used : SomeToolingModel(org.gradle.configurationcache.fixtures.SomeToolingModel) ArrayList(java.util.ArrayList) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Example 2 with SomeToolingModel

use of org.gradle.configurationcache.fixtures.SomeToolingModel in project gradle by gradle.

the class FetchPartialCustomModelForEachProject method execute.

@Override
public List<String> execute(BuildController controller) {
    List<String> result = new ArrayList<>();
    GradleBuild buildModel = controller.getBuildModel();
    for (BasicGradleProject project : buildModel.getProjects()) {
        SomeToolingModel model = controller.findModel(project, SomeToolingModel.class);
        if (model != null) {
            result.add(model.getMessage());
        }
    }
    return result;
}
Also used : SomeToolingModel(org.gradle.configurationcache.fixtures.SomeToolingModel) ArrayList(java.util.ArrayList) BasicGradleProject(org.gradle.tooling.model.gradle.BasicGradleProject) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Example 3 with SomeToolingModel

use of org.gradle.configurationcache.fixtures.SomeToolingModel in project gradle by gradle.

the class FetchCustomModelForEachProject method execute.

@Override
public List<SomeToolingModel> execute(BuildController controller) {
    List<SomeToolingModel> result = new ArrayList<>();
    GradleBuild buildModel = controller.getBuildModel();
    for (BasicGradleProject project : buildModel.getProjects()) {
        SomeToolingModel model = controller.findModel(project, SomeToolingModel.class);
        if (model != null) {
            result.add(model);
        }
    }
    return result;
}
Also used : SomeToolingModel(org.gradle.configurationcache.fixtures.SomeToolingModel) ArrayList(java.util.ArrayList) BasicGradleProject(org.gradle.tooling.model.gradle.BasicGradleProject) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Aggregations

ArrayList (java.util.ArrayList)3 SomeToolingModel (org.gradle.configurationcache.fixtures.SomeToolingModel)3 GradleBuild (org.gradle.tooling.model.gradle.GradleBuild)3 BasicGradleProject (org.gradle.tooling.model.gradle.BasicGradleProject)2