Search in sources :

Example 6 with BasicGradleProject

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

the class ComplexCustomModelBuildingAction method execute.

@Override
public Map<String, CustomModel> execute(BuildController controller) {
    Map<String, CustomModel> result = new HashMap<String, CustomModel>();
    for (BasicGradleProject project : controller.getBuildModel().getProjects()) {
        result.put(project.getPath(), controller.getModel(project, CustomModel.class));
    }
    CustomModel rootProjectModel = controller.getModel(controller.getBuildModel().getRootProject(), CustomModel.class);
    for (CustomModel customModel : result.values()) {
        assert customModel.getThing() == rootProjectModel.getThing();
    }
    return result;
}
Also used : HashMap(java.util.HashMap) BasicGradleProject(org.gradle.tooling.model.gradle.BasicGradleProject) CustomModel(org.gradle.integtests.tooling.r16.CustomModel)

Aggregations

BasicGradleProject (org.gradle.tooling.model.gradle.BasicGradleProject)6 HashMap (java.util.HashMap)4 Set (java.util.Set)2 CustomModel (org.gradle.integtests.tooling.r16.CustomModel)2 TaskSelector (org.gradle.tooling.model.TaskSelector)2 BuildInvocations (org.gradle.tooling.model.gradle.BuildInvocations)2 GradleBuild (org.gradle.tooling.model.gradle.GradleBuild)2 AndroidProject (com.android.builder.model.AndroidProject)1 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1 LinkedHashMap (java.util.LinkedHashMap)1 LinkedHashSet (java.util.LinkedHashSet)1 TreeMap (java.util.TreeMap)1 Task (org.gradle.tooling.model.Task)1 AllTasksModel (org.grails.cli.gradle.FetchAllTaskSelectorsBuildAction.AllTasksModel)1