Skip to content

Commit

Permalink
Improve IDE detection
Browse files Browse the repository at this point in the history
* Test more possible cases for Windows
* Support detection for multi-module projects

Fixes: quarkusio#18676
  • Loading branch information
geoand committed Jul 14, 2021
1 parent 75a14d3 commit bda6dec
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@ public class IdeProcessor {
if ((jbrIndex > -1) && command.endsWith("java")) {
String ideaHome = command.substring(0, jbrIndex);
return (ideaHome + "bin" + File.separator + "idea") + (IdeUtil.isWindows() ? ".exe" : ".sh");
} else if (IdeUtil.isWindows() && (command.endsWith("idea.exe") || command.endsWith("idea64.exe"))) {
// based on input from https://github.com/quarkusio/quarkus/issues/18676#issuecomment-879775007
return command;
}
return null;
});
Expand Down Expand Up @@ -139,6 +142,15 @@ public IdeFileBuildItem detectIdeFiles(LaunchModeBuildItem launchModeBuildItem,
result.addAll(ides);
}
});
if (result.isEmpty()) {
// hack to try and guess the IDE when using a multi-module project
Path parent = projectRoot.getParent();
IDE_MARKER_FILES.forEach((file, ides) -> {
if (Files.exists(parent.resolve(file))) {
result.addAll(ides);
}
});
}
return new IdeFileBuildItem(result);
}

Expand Down

0 comments on commit bda6dec

Please sign in to comment.