ART: Retire desugar and dx in run-tests

Run-tests now use d8 for desugaring and dexing.

Build scripts no longer have hand written dexer invocations.

Bug: 110150973
Bug: 73711890
Test: art/test.py --host --64 -r
Test: art/test.py --target --prebuild --optimizing -r
Change-Id: Iae2199cf756624c1f045de7777c5ee6432398bd2
diff --git a/test/004-StackWalk/build b/test/004-StackWalk/build
index 3bb63ca..eeecbfc 100644
--- a/test/004-StackWalk/build
+++ b/test/004-StackWalk/build
@@ -17,9 +17,25 @@
 # Stop if something fails.
 set -e
 
-# The test relies on DEX file produced by javac+dx so keep building with them for now
-# (see b/19467889)
-mkdir classes
-${JAVAC} -d classes `find src -name '*.java'`
-${DX} -JXmx256m --debug --dex --output=classes.dex ${DX_FLAGS} classes
-zip $TEST_NAME.jar classes.dex
+# This test depends on the exact format of the DEX file. Since dx is deprecated,
+# the classes.dex file is packaged as a test input. It was created with:
+#
+# $ javac -g -Xlint:-options -source 1.7 -target 1.7 -d classes src/Main.java
+# $ dx --debug --dex --output=classes.dex classes
+
+# Wrapper function for javac which for this test does nothing as the
+# test uses a pre-built DEX file.
+function javac_wrapper {
+  return 0
+}
+
+export -f javac_wrapper
+export JAVAC=javac_wrapper
+
+# Do not invoke D8 for this test.
+export D8=':'
+
+######################################################################
+
+jar -cf classes.jar classes.dex
+./default-build "$@"