GerritLauncher: Remove isBazel method
Change-Id: I0390b80ad1fe3dbea886f73ff5cf23fc93861c94
This commit is contained in:
@@ -627,36 +627,6 @@ public final class GerritLauncher {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static String SOURCE_ROOT_RESOURCE = "/gerrit-launcher/workspace-root.txt";
|
static String SOURCE_ROOT_RESOURCE = "/gerrit-launcher/workspace-root.txt";
|
||||||
static String PRIMARY_BUILD_TOOL = ".primary_build_tool";
|
|
||||||
|
|
||||||
/** returns whether we're running out of a bazel build. */
|
|
||||||
public static boolean isBazel() {
|
|
||||||
Class<GerritLauncher> self = GerritLauncher.class;
|
|
||||||
URL rootURL = self.getResource(SOURCE_ROOT_RESOURCE);
|
|
||||||
if (rootURL != null) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
Path p = null;
|
|
||||||
try {
|
|
||||||
p = resolveInSourceRoot("eclipse-out");
|
|
||||||
if (!Files.exists(p)) {
|
|
||||||
p = resolveInSourceRoot("bazel-out");
|
|
||||||
}
|
|
||||||
Path path = p.getParent().resolve(PRIMARY_BUILD_TOOL);
|
|
||||||
if (Files.exists(path)) {
|
|
||||||
String content = new String(Files.readAllBytes(path));
|
|
||||||
if (content.toLowerCase().contains("bazel")) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (IOException e) {
|
|
||||||
// Ignore
|
|
||||||
}
|
|
||||||
|
|
||||||
// Not Bazel then
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Locate a path in the source tree.
|
* Locate a path in the source tree.
|
||||||
|
Reference in New Issue
Block a user