More run-test build determinism tweaks (part 2) am: 4bd6795677

Original change: https://android-review.googlesource.com/c/platform/art/+/1808736

Change-Id: Ia3ff7c60ca70e24d6a1697a6a5c9f039a21ce64a
diff --git a/test/968-default-partial-compile-gen/util-src/generate_java.py b/test/968-default-partial-compile-gen/util-src/generate_java.py
index 35290ef..ce3c912 100755
--- a/test/968-default-partial-compile-gen/util-src/generate_java.py
+++ b/test/968-default-partial-compile-gen/util-src/generate_java.py
@@ -67,7 +67,7 @@
     """
     args = args.split()
     files = list(map(str, files))
-    cmd = ['sh', '-a', '-e', '--', str(self.javac)] + args + files
+    cmd = ['sh', '-a', '-e', '--', str(self.javac)] + args + sorted(files)
     print("Running compile command: {}".format(cmd))
     subprocess.check_call(cmd)
     print("Compiled {} files".format(len(files)))
diff --git a/test/971-iface-super/util-src/generate_java.py b/test/971-iface-super/util-src/generate_java.py
index 99b0479..c246e88 100755
--- a/test/971-iface-super/util-src/generate_java.py
+++ b/test/971-iface-super/util-src/generate_java.py
@@ -67,7 +67,7 @@
     """
     args = args.split()
     files = list(map(str, files))
-    cmd = ['sh', '-a', '-e', '--', str(self.javac)] + args + files
+    cmd = ['sh', '-a', '-e', '--', str(self.javac)] + args + sorted(files)
     print("Running compile command: {}".format(cmd))
     subprocess.check_call(cmd)
     print("Compiled {} files".format(len(files)))
diff --git a/test/etc/default-build b/test/etc/default-build
index 56cb918..244d75f 100755
--- a/test/etc/default-build
+++ b/test/etc/default-build
@@ -278,7 +278,7 @@
 # packaged in a jar file.
 function make_dex() {
   local name="$1"
-  local d8_inputs=$(find $name -name '*.class' -type f)
+  local d8_inputs=$(find $name -name '*.class' -type f | sort)
   local d8_output=${name}.jar
   local dex_output=${name}.dex
   local d8_local_flags=""