use of org.gradle.integtests.tooling.r16.CustomModel in project gradle by gradle.
the class UseOtherTypesToFetchProjectModel method execute.
public Map<String, CustomModel> execute(BuildController controller) {
// Use an IdeaModule to reference a project
IdeaProject ideaProject = controller.getModel(IdeaProject.class);
for (IdeaModule ideaModule : ideaProject.getModules()) {
visit(ideaModule, controller, new HashMap<String, CustomModel>());
}
// Use an EclipseProject to reference a project
EclipseProject eclipseProject = controller.getModel(EclipseProject.class);
visit(eclipseProject, controller, new HashMap<String, CustomModel>());
// Use a GradleProject to reference a project
GradleProject rootProject = controller.getModel(GradleProject.class);
Map<String, CustomModel> projects = new HashMap<String, CustomModel>();
visit(rootProject, controller, projects);
return projects;
}
use of org.gradle.integtests.tooling.r16.CustomModel in project gradle by gradle.
the class UseGradleBuildToFetchProjectModel method execute.
public Map<String, CustomModel> execute(BuildController controller) {
GradleBuild gradleBuild = controller.getBuildModel();
Map<String, CustomModel> projects = new HashMap<String, CustomModel>();
for (BasicGradleProject project : gradleBuild.getProjects()) {
projects.put(project.getName(), controller.getModel(project, CustomModel.class));
}
return projects;
}
use of org.gradle.integtests.tooling.r16.CustomModel 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;
}
use of org.gradle.integtests.tooling.r16.CustomModel in project gradle by gradle.
the class CustomModelBuildingAction method execute.
@Override
public CustomModel execute(BuildController controller) {
CustomModel model1 = controller.getModel(CustomModel.class);
CustomModel model2 = controller.getModel(CustomModel.class);
assert model1.getThing() == model2.getThing();
return model1;
}
Aggregations