ExceptionHelper.checkNotNullArgument(project, "project");
ExceptionHelper.checkNotNullArgument(ideaProject, "ideaProject");
ExceptionHelper.checkNotNullArgument(otherModels, "otherModels");
File projectDir = project.getProjectDirectoryAsFile();
IdeaModule mainModule = IdeaJavaModelUtils.tryFindMainModule(projectDir, ideaProject);
if (mainModule == null) {
throw new IOException("Failed to find idea module for project: " + project.getDisplayName());
}
IdeaModule rootModule = tryFindRootModule(ideaProject);
if (rootModule == null) {
throw new IOException("Failed to find root module for project: " + project.getDisplayName());
}
NbGradleProjectTree rootTree = tryCreateProjectTreeFromIdea(rootModule);
if (rootTree == null) {
throw new IOException("Failed to find root tree for project: " + rootModule.getName());
}
String rootPath = rootModule.getGradleProject().getPath();
for (IdeaModule otherModule: ideaProject.getModules()) {
// This comparison is not strictly necessary but there is no reason
// to reparse the main project.
if (otherModule != mainModule) {
if (rootPath.equals(otherModule.getGradleProject().getPath())) {