Use prebuilt dex version of JDWP in debug tests.

Testing D8 compilation of JDWP is done by RunJdwpTest which will D8-compile JDWP
and run the set of smoke tests with both the debugger and debuggee being run on
ART.

Change-Id: Ib671fc6d17f7ed193bd8cc13d10b983530a5fd4f
diff --git a/build.gradle b/build.gradle
index 8a5830d..7fcbda6 100644
--- a/build.gradle
+++ b/build.gradle
@@ -1165,6 +1165,23 @@
     includeEmptyDirs = false
 }
 
+task buildPreNJdwpTestsDex(type: Exec, dependsOn: "buildPreNJdwpTestsJar") {
+    def inFile = buildPreNJdwpTestsJar.archivePath
+    def outFile = new File(buildPreNJdwpTestsJar.destinationDir, buildPreNJdwpTestsJar.baseName + '-dex.jar')
+    inputs.file inFile
+    outputs.file outFile
+    if (OperatingSystem.current().isWindows()) {
+        executable file("tools/windows/dx/bin/dx.bat")
+    } else if (OperatingSystem.current().isMacOsX()) {
+        executable file("tools/mac/dx/bin/dx");
+    } else {
+        executable file("tools/linux/dx/bin/dx");
+    }
+    args "--dex"
+    args "--output=${outFile}"
+    args inFile
+}
+
 task supportLibDir() {
     doLast {
         File dir = file("build/supportlibraries")