IDEA-154371 New Project / Module wizard: Gradle: switching Off all "Additional Libraries and Frameworks" creates module content root in unrelated location

This commit is contained in:
Vladislav.Soroka
2016-04-08 18:19:45 +03:00
parent 94e9048976
commit 8ad947dd59
@@ -628,7 +628,10 @@ public class GradleProjectResolver implements ExternalSystemProjectResolver<Grad
@NotNull DataNode<? extends ModuleData> moduleNode) {
final File buildDir = externalProject.getBuildDir();
final MultiMap<String, ContentRootData> sourceSetRoots = MultiMap.create();
for (DataNode<ContentRootData> contentRootNode : ExternalSystemApiUtil.findAll(moduleNode, ProjectKeys.CONTENT_ROOT)) {
Collection<DataNode<ContentRootData>> contentRootNodes = ExternalSystemApiUtil.findAll(moduleNode, ProjectKeys.CONTENT_ROOT);
if(contentRootNodes.size() <= 1) return;
for (DataNode<ContentRootData> contentRootNode : contentRootNodes) {
File root = new File(contentRootNode.getData().getRootPath());
if (FileUtil.isAncestor(buildDir, root, true)) continue;