Search in sources :

Example 21 with GradleBuild

use of org.gradle.tooling.model.gradle.GradleBuild in project gradle by gradle.

the class ActionRunsNestedActions method execute.

@Override
public Models execute(BuildController controller) {
    GradleBuild buildModel = controller.getBuildModel();
    List<GetProjectModel> projectActions = new ArrayList<GetProjectModel>();
    for (BasicGradleProject project : buildModel.getProjects()) {
        projectActions.add(new GetProjectModel(project));
    }
    List<CustomModel> results = controller.run(projectActions);
    return new Models(controller.getCanQueryProjectModelInParallel(CustomModel.class), results);
}
Also used : ArrayList(java.util.ArrayList) BasicGradleProject(org.gradle.tooling.model.gradle.BasicGradleProject) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Example 22 with GradleBuild

use of org.gradle.tooling.model.gradle.GradleBuild 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

GradleBuild (org.gradle.tooling.model.gradle.GradleBuild)22 ArrayList (java.util.ArrayList)15 BasicGradleProject (org.gradle.tooling.model.gradle.BasicGradleProject)8 EclipseProject (org.gradle.tooling.model.eclipse.EclipseProject)4 SomeToolingModel (org.gradle.configurationcache.fixtures.SomeToolingModel)3 BuildEnvironment (org.gradle.tooling.model.build.BuildEnvironment)3 NotNull (org.jetbrains.annotations.NotNull)3 File (java.io.File)2 IOException (java.io.IOException)2 GradleProject (org.gradle.tooling.model.GradleProject)2 AndroidProject (com.android.builder.model.AndroidProject)1 TaskData (com.intellij.openapi.externalSystem.model.task.TaskData)1 HashMap (java.util.HashMap)1 TreeMap (java.util.TreeMap)1 CustomModel (org.gradle.integtests.tooling.r16.CustomModel)1 GradleTask (org.gradle.tooling.model.GradleTask)1 CppProject (org.gradle.tooling.model.cpp.CppProject)1 BuildInvocations (org.gradle.tooling.model.gradle.BuildInvocations)1 BasicIdeaProject (org.gradle.tooling.model.idea.BasicIdeaProject)1 IdeaModule (org.gradle.tooling.model.idea.IdeaModule)1