Search in sources :

Example 1 with GradleBuild

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

the class FetchBuildEnvironments method execute.

@Override
public List<BuildEnvironment> execute(BuildController controller) {
    List<BuildEnvironment> environments = new ArrayList<BuildEnvironment>();
    GradleBuild build = controller.getBuildModel();
    environments.add(controller.getModel(build, BuildEnvironment.class));
    for (GradleBuild includedBuild : build.getIncludedBuilds()) {
        environments.add(controller.getModel(includedBuild, BuildEnvironment.class));
    }
    return environments;
}
Also used : BuildEnvironment(org.gradle.tooling.model.build.BuildEnvironment) ArrayList(java.util.ArrayList) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Example 2 with GradleBuild

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

the class FetchBuildEnvironments method execute.

@Override
public List<BuildEnvironment> execute(BuildController controller) {
    List<BuildEnvironment> environments = new ArrayList<BuildEnvironment>();
    GradleBuild build = controller.getBuildModel();
    environments.add(controller.getModel(build, BuildEnvironment.class));
    for (GradleBuild includedBuild : build.getIncludedBuilds()) {
        environments.add(controller.getModel(includedBuild, BuildEnvironment.class));
    }
    return environments;
}
Also used : BuildEnvironment(org.gradle.tooling.model.build.BuildEnvironment) ArrayList(java.util.ArrayList) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Example 3 with GradleBuild

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

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

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

the class FetchCustomModelForEachProjectInParallel method execute.

@Override
public List<SomeToolingModel> execute(BuildController controller) {
    List<FetchModelForProject> actions = new ArrayList<>();
    GradleBuild buildModel = controller.getBuildModel();
    for (BasicGradleProject project : buildModel.getProjects()) {
        actions.add(new FetchModelForProject(project));
    }
    return controller.run(actions);
}
Also used : 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