From 1a4669d7ee2ee54d1e1e9a16791a3a6fa6c3d601 Mon Sep 17 00:00:00 2001 From: Marcin Abramowicz Date: Thu, 10 Feb 2022 18:59:20 +0100 Subject: [PATCH] bazel in install update --- .../main/java/org/jetbrains/bsp/bazel/install/Install.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install/src/main/java/org/jetbrains/bsp/bazel/install/Install.java b/install/src/main/java/org/jetbrains/bsp/bazel/install/Install.java index 29662047d..cf27c46e9 100644 --- a/install/src/main/java/org/jetbrains/bsp/bazel/install/Install.java +++ b/install/src/main/java/org/jetbrains/bsp/bazel/install/Install.java @@ -75,7 +75,7 @@ public static void main(String[] args) throws IOException { addJavaClasspath(argv); addDebuggerConnection(cmd, argv, projectView); argv.add(SERVER_CLASS_NAME); - addBazelBinary(cmd, argv); + addBazelBinary(cmd, argv, projectView); addBazelTargets(cmd, argv); BspConnectionDetails details = createBspConnectionDetails(argv); @@ -114,9 +114,11 @@ private static BspConnectionDetails createBspConnectionDetails(List argv Constants.SUPPORTED_LANGUAGES); } - private static void addBazelBinary(CommandLine cmd, List argv) { + private static void addBazelBinary(CommandLine cmd, List argv, ProjectView projectView) { if (cmd.hasOption(BAZEL_SHORT_OPT)) { argv.add(cmd.getOptionValue(BAZEL_SHORT_OPT)); + } else if (projectView.getBazelPath().isPresent()) { + argv.add(projectView.getBazelPath().get().getValue()); } else { argv.add(findOnPath("bazel")); }