Search in sources :

Example 11 with EclipseModel

use of org.gradle.plugins.ide.eclipse.model.EclipseModel in project gradle by gradle.

the class EclipseModelBuilder method buildHierarchy.

private DefaultEclipseProject buildHierarchy(Project project) {
    List<DefaultEclipseProject> children = new ArrayList<>();
    for (Project child : project.getChildProjects().values()) {
        children.add(buildHierarchy(child));
    }
    EclipseModel eclipseModel = project.getExtensions().getByType(EclipseModel.class);
    org.gradle.plugins.ide.eclipse.model.EclipseProject internalProject = eclipseModel.getProject();
    String name = internalProject.getName();
    String description = GUtil.elvis(internalProject.getComment(), null);
    DefaultEclipseProject eclipseProject = new DefaultEclipseProject(name, project.getPath(), description, project.getProjectDir(), children).setGradleProject(rootGradleProject.findByPath(project.getPath()));
    for (DefaultEclipseProject child : children) {
        child.setParent(eclipseProject);
    }
    addProject(project, eclipseProject);
    return eclipseProject;
}
Also used : Project(org.gradle.api.Project) EclipseWorkspaceProject(org.gradle.tooling.model.eclipse.EclipseWorkspaceProject) DefaultGradleProject(org.gradle.plugins.ide.internal.tooling.model.DefaultGradleProject) DefaultEclipseProject(org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseProject) ArrayList(java.util.ArrayList) EclipseModel(org.gradle.plugins.ide.eclipse.model.EclipseModel) DefaultEclipseProject(org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseProject)

Aggregations

EclipseModel (org.gradle.plugins.ide.eclipse.model.EclipseModel)11 ArrayList (java.util.ArrayList)6 Project (org.gradle.api.Project)6 Properties (java.util.Properties)2 Task (org.gradle.api.Task)2 Delete (org.gradle.api.tasks.Delete)2 SourceSet (org.gradle.api.tasks.SourceSet)2 DefaultEclipseProject (org.gradle.plugins.ide.internal.tooling.eclipse.DefaultEclipseProject)2 DefaultGradleProject (org.gradle.plugins.ide.internal.tooling.model.DefaultGradleProject)2 EclipseWorkspaceProject (org.gradle.tooling.model.eclipse.EclipseWorkspaceProject)2 IdlOptions (com.linkedin.pegasus.gradle.PegasusOptions.IdlOptions)1 CompatibilityLogChecker (com.linkedin.pegasus.gradle.internal.CompatibilityLogChecker)1 ChangedFileReportTask (com.linkedin.pegasus.gradle.tasks.ChangedFileReportTask)1 CheckIdlTask (com.linkedin.pegasus.gradle.tasks.CheckIdlTask)1 CheckPegasusSnapshotTask (com.linkedin.pegasus.gradle.tasks.CheckPegasusSnapshotTask)1 CheckRestModelTask (com.linkedin.pegasus.gradle.tasks.CheckRestModelTask)1 CheckSnapshotTask (com.linkedin.pegasus.gradle.tasks.CheckSnapshotTask)1 GenerateAvroSchemaTask (com.linkedin.pegasus.gradle.tasks.GenerateAvroSchemaTask)1 GenerateDataTemplateTask (com.linkedin.pegasus.gradle.tasks.GenerateDataTemplateTask)1 GeneratePegasusSnapshotTask (com.linkedin.pegasus.gradle.tasks.GeneratePegasusSnapshotTask)1