Build (@NotNull IdeaProject ideaProject) { String name = ideaProject.getName(); DomainObjectSet<? extends IdeaModule> ideaModules = ideaProject.getChildren(); assert !ideaModules.isEmpty() : "Cannot evaluate build identifier for IdeaProject"; File rootDir = ideaModules.getAt(0).getGradleProject().getProjectIdentifier().getBuildIdentifier().getRootDir(); DefaultBuild build = new DefaultBuild(name, rootDir); for (IdeaModule ideaModule : ideaModules) { build.myProjects.add(DefaultProject.convertIdeaProject(ideaModule)); } return build; }