Skip to content

Commit

Permalink
[IDEA-363401] revert logic of ModuleExcludeIndexImpl as it should be
Browse files Browse the repository at this point in the history
Avoiding deleting the project dir in case if module output is empty (true for all maven projects)


(cherry picked from commit b385d3b408f9378f5bd2c9c553712cd1ad03a4a1)

IJ-CR-150866

GitOrigin-RevId: 4863b729d96f1e4785771af94e77e7961a1b67af
  • Loading branch information
zulkar authored and intellij-monorepo-bot committed Dec 6, 2024
1 parent bf73d5e commit 8875af5
Showing 1 changed file with 10 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,18 @@ public ModuleExcludeIndexImpl(JpsModel model) {
JpsJavaProjectExtension projectExtension = JpsJavaExtensionService.getInstance().getProjectExtension(model.getProject());
if (projectExtension != null) {
String url = projectExtension.getOutputUrl();
if (Strings.isEmpty(url)) {
return;
}

Path excluded = Path.of(JpsPathUtil.urlToPath(url));
Path parent = excluded;
while (parent != null) {
JpsModule module = contentToModule.get(parent);
if (module != null) {
myModuleToExcludesMap.get(module).add(excluded);
if (!Strings.isEmpty(url)) {
Path excluded = Path.of(JpsPathUtil.urlToPath(url));
Path parent = excluded;
while (parent != null) {
JpsModule module = contentToModule.get(parent);
if (module != null) {
myModuleToExcludesMap.get(module).add(excluded);
}
parent = parent.getParent();
}
parent = parent.getParent();
myExcludedRoots.add(excluded);
}
myExcludedRoots.add(excluded);
}

List<Path> parents = new ArrayList<>();
Expand Down

0 comments on commit 8875af5

Please sign in to comment.