Search in sources :

Example 1 with EclipseProject

use of org.gradle.tooling.model.eclipse.EclipseProject 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;
}
Also used : EclipseProject(org.gradle.tooling.model.eclipse.EclipseProject) IdeaProject(org.gradle.tooling.model.idea.IdeaProject) IdeaModule(org.gradle.tooling.model.idea.IdeaModule) HashMap(java.util.HashMap) GradleProject(org.gradle.tooling.model.GradleProject) CustomModel(org.gradle.integtests.tooling.r16.CustomModel)

Example 2 with EclipseProject

use of org.gradle.tooling.model.eclipse.EclipseProject in project gradle by gradle.

the class FetchEclipseProjects method execute.

@Override
public List<EclipseProject> execute(BuildController controller) {
    List<EclipseProject> eclipseProjects = new ArrayList<EclipseProject>();
    GradleBuild build = controller.getBuildModel();
    collectEclipseProjects(build, eclipseProjects, controller);
    return eclipseProjects;
}
Also used : EclipseProject(org.gradle.tooling.model.eclipse.EclipseProject) ArrayList(java.util.ArrayList) GradleBuild(org.gradle.tooling.model.gradle.GradleBuild)

Aggregations

EclipseProject (org.gradle.tooling.model.eclipse.EclipseProject)2 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 CustomModel (org.gradle.integtests.tooling.r16.CustomModel)1 GradleProject (org.gradle.tooling.model.GradleProject)1 GradleBuild (org.gradle.tooling.model.gradle.GradleBuild)1 IdeaModule (org.gradle.tooling.model.idea.IdeaModule)1 IdeaProject (org.gradle.tooling.model.idea.IdeaProject)1