Update tests to work with jdk11 as the system runtime.
This is in preperation for updating the system runtime.
Bug: b/227300698
Change-Id: Ic21efb5002e89792d220a44cd8ac276724067431
diff --git a/buildSrc/src/main/java/utils/Utils.java b/buildSrc/src/main/java/utils/Utils.java
index 7843edd..7f09b81 100644
--- a/buildSrc/src/main/java/utils/Utils.java
+++ b/buildSrc/src/main/java/utils/Utils.java
@@ -3,7 +3,8 @@
// BSD-style license that can be found in the LICENSE file.
package utils;
-import java.io.File;
+import java.nio.file.Path;
+import java.nio.file.Paths;
public class Utils {
public static String toolsDir() {
@@ -17,13 +18,17 @@
}
}
- public static File dxExecutable() {
- String dxExecutableName = Utils.toolsDir().equals("windows") ? "dx.bat" : "dx";
- return new File("tools/" + Utils.toolsDir() + "/dx/bin/" + dxExecutableName);
+ public static boolean isWindows() {
+ return toolsDir().equals("windows");
}
- public static File dexMergerExecutable() {
- String executableName = Utils.toolsDir().equals("windows") ? "dexmerger.bat" : "dexmerger";
- return new File("tools/" + Utils.toolsDir() + "/dx/bin/" + executableName);
+ public static Path dxExecutable() {
+ String dxExecutableName = isWindows() ? "dx.bat" : "dx";
+ return Paths.get("tools", toolsDir(), "dx", "bin", dxExecutableName);
+ }
+
+ public static Path dexMergerExecutable() {
+ String executableName = isWindows() ? "dexmerger.bat" : "dexmerger";
+ return Paths.get("tools", toolsDir(), "dx", "bin", executableName);
}
}