Remove leftover dx infrastructure

Bug: 185205222
Change-Id: Ie0afeb5a7c3a5eac6f08bed9dbdc77e3e276ade5
diff --git a/src/test/java/com/android/tools/r8/ToolHelper.java b/src/test/java/com/android/tools/r8/ToolHelper.java
index c9cd81f..1de3552 100644
--- a/src/test/java/com/android/tools/r8/ToolHelper.java
+++ b/src/test/java/com/android/tools/r8/ToolHelper.java
@@ -588,23 +588,6 @@
     return filePathList.stream().map(File::new).collect(Collectors.toList());
   }
 
-  public static class DXCommandBuilder extends CommandBuilder {
-
-    public DXCommandBuilder() {
-      appendProgramArgument("--dex");
-    }
-
-    @Override
-    protected boolean shouldUseDocker() {
-      return false;
-    }
-
-    @Override
-    protected String getExecutable() {
-      return DX.toAbsolutePath().toString();
-    }
-  }
-
   private static class StreamReader implements Runnable {
 
     private InputStream stream;
@@ -734,7 +717,6 @@
     PRODUCT = builder.build();
   }
 
-  private static final Path DX = getDxExecutablePath();
 
   private static Path getDexVmPath(DexVm vm) {
     DexVm.Version version = vm.getVersion();
@@ -858,12 +840,6 @@
     return new Backend[]{Backend.DEX};
   }
 
-  private static Path getDxExecutablePath() {
-    String toolsDir = toolsDir();
-    String executableName = toolsDir.equals("windows") ? "dx.bat" : "dx";
-    return Paths.get(TOOLS_DIR, toolsDir(), "dx", "bin", executableName);
-  }
-
   public static String getArtBinary(DexVm version) {
     return getArtDir(version) + "/" + getRawArtBinary(version);
   }
@@ -1474,41 +1450,6 @@
     return GenerateMainDexList.runForTesting(command.getInputApp(), internalOptions);
   }
 
-  public static AndroidApp runDexer(String fileName, String outDir, String... extraArgs)
-      throws IOException {
-    List<String> args = new ArrayList<>();
-    Collections.addAll(args, extraArgs);
-    Collections.addAll(args, "--output=" + outDir + "/classes.dex", fileName);
-    int result = runDX(args.toArray(StringUtils.EMPTY_ARRAY)).exitCode;
-    return result != 0 ? null : builderFromProgramDirectory(Paths.get(outDir)).build();
-  }
-
-  public static ProcessResult runDX(String... args) throws IOException {
-    return runDX(null, args);
-  }
-
-  public static ProcessResult runDX(Path workingDirectory, String... args) throws IOException {
-    return runProcess(createProcessBuilderForRunningDx(workingDirectory, args));
-  }
-
-  public static ProcessBuilder createProcessBuilderForRunningDx(String... args) {
-    return createProcessBuilderForRunningDx(null, args);
-  }
-
-  public static ProcessBuilder createProcessBuilderForRunningDx(
-      Path workingDirectory, String... args) {
-    Assume.assumeTrue(ToolHelper.artSupported());
-    DXCommandBuilder builder = new DXCommandBuilder();
-    for (String arg : args) {
-      builder.appendProgramArgument(arg);
-    }
-    ProcessBuilder pb = builder.asProcessBuilder();
-    if (workingDirectory != null) {
-      pb.directory(workingDirectory.toFile());
-    }
-    return pb;
-  }
-
   @Deprecated
   public static ProcessResult runJava(Class clazz) throws Exception {
     String main = clazz.getTypeName();
diff --git a/src/test/java/com/android/tools/r8/debug/BreakPointEventsTestRunner.java b/src/test/java/com/android/tools/r8/debug/BreakPointEventsTestRunner.java
index 9031043..fb983bc 100644
--- a/src/test/java/com/android/tools/r8/debug/BreakPointEventsTestRunner.java
+++ b/src/test/java/com/android/tools/r8/debug/BreakPointEventsTestRunner.java
@@ -52,17 +52,6 @@
     return new CfDebugTestConfig(ToolHelper.getClassPathForTests()).addPaths(outCf);
   }
 
-  public static DebugTestConfig dxConfig() throws Exception {
-    Path cwd = ToolHelper.getClassPathForTests().toAbsolutePath();
-    Path test = cwd.relativize(getClassFilePath().toAbsolutePath());
-    Path out = getStaticTemp().newFolder().toPath().resolve("classes.dex").toAbsolutePath();
-    ProcessResult result = ToolHelper.runDX(cwd, "--output=" + out, test.toString());
-    assertTrue(result.stderr, 0 == result.exitCode);
-    DebugTestConfig config = new DexDebugTestConfig();
-    config.addPaths(out);
-    return config;
-  }
-
   public void printConfig(String name, DebugTestConfig config) throws Exception {
     new DebugStreamComparator()
         .add(name, streamDebugTest(config, CLASS.getCanonicalName(), NO_FILTER))
@@ -83,8 +72,6 @@
       runner.printConfig("CF", cfConfig());
       System.out.println("\n============== D8 single stepping: ");
       runner.printConfig("D8", d8Config());
-      System.out.println("\n============== DX single stepping: ");
-      runner.printConfig("DX", dxConfig());
     } finally {
       getStaticTemp().delete();
     }
diff --git a/src/test/java/com/android/tools/r8/jar/UnicodeSetRegression/UnicodeSetRegressionTest.java b/src/test/java/com/android/tools/r8/jar/UnicodeSetRegression/UnicodeSetRegressionTest.java
index 9b41eec..708e588 100644
--- a/src/test/java/com/android/tools/r8/jar/UnicodeSetRegression/UnicodeSetRegressionTest.java
+++ b/src/test/java/com/android/tools/r8/jar/UnicodeSetRegression/UnicodeSetRegressionTest.java
@@ -24,10 +24,6 @@
   private static final String JAR_FILE =
       "src/test/java/com/android/tools/r8/jar/UnicodeSetRegression/UnicodeSet.jar";
 
-  private AndroidApp dexFromDX() throws IOException {
-    return ToolHelper.runDexer(JAR_FILE, temp.newFolder("dx-dex").getPath());
-  }
-
   @Test
   public void testUnicodeSetFromJar() throws Throwable {
     Path combinedInput = temp.getRoot().toPath().resolve("all.zip");
diff --git a/src/test/java/com/android/tools/r8/jasmin/JasminTestBase.java b/src/test/java/com/android/tools/r8/jasmin/JasminTestBase.java
index 865f40e..20de747 100644
--- a/src/test/java/com/android/tools/r8/jasmin/JasminTestBase.java
+++ b/src/test/java/com/android/tools/r8/jasmin/JasminTestBase.java
@@ -197,45 +197,6 @@
     return runOnArtRaw(result, libraryApp, main);
   }
 
-  private ProcessResult runDx(JasminBuilder builder, File classes, Path dex) throws Exception {
-    builder.writeClassFiles(classes.toPath());
-    List<String> args = new ArrayList<>();
-    args.add("--output=" + dex.toString());
-    args.add(classes.toString());
-    System.out.println("running: dx " + StringUtils.join(" ", args));
-    return ToolHelper.runDX(args.toArray(new String[args.size()]));
-  }
-
-  protected ProcessResult runDX(JasminBuilder builder) throws Exception {
-    return runDx(builder, temp.newFolder("classes_for_dx"),
-        temp.getRoot().toPath().resolve("classes.dex"));
-  }
-
-  protected String runOnArtDx(JasminBuilder builder, String main) throws Exception {
-    Path dex = temp.getRoot().toPath().resolve("classes.dex");
-    ProcessResult result = runDx(builder, temp.newFolder("classes_for_dx"), dex);
-    assertNormalExitAndGetStdout(result);
-    return ToolHelper.runArtNoVerificationErrors(dex.toString(), main);
-  }
-
-  protected ProcessResult runOnArtDxRaw(JasminBuilder builder, String main) throws Exception {
-    Path dex = temp.getRoot().toPath().resolve("classes.dex");
-    ProcessResult result = runDx(builder, temp.newFolder("classes_for_dx"), dex);
-    assertNormalExitAndGetStdout(result);
-    return ToolHelper.runArtRaw(dex.toString(), main);
-  }
-
-  protected ProcessResult runOnArtDxRaw(JasminBuilder program, JasminBuilder library, String main)
-      throws Exception {
-    Path dex = temp.getRoot().toPath().resolve("classes.dex");
-    ProcessResult result = runDx(program, temp.newFolder("classes_for_dx"), dex);
-    assertNormalExitAndGetStdout(result);
-    Path libraryDex = temp.getRoot().toPath().resolve("library.dex");
-    result = runDx(library, temp.newFolder("classes_for_library_dx"), libraryDex);
-    assertNormalExitAndGetStdout(result);
-    return ToolHelper.runArtRaw(ImmutableList.of(dex.toString(), libraryDex.toString()), main, null);
-  }
-
   @Override
   protected ProcessResult runOnArtRaw(AndroidApp app, String main) throws IOException {
     Path out = temp.getRoot().toPath().resolve("out.zip");