Run-test build: Pass tools to the script explicitly

Pass tools as command line arguments rather than hard-coding
the sand-box directory structure.

Convert the paths involved from string to pathlib.Path

Test: Generated build artifacts are identical
Change-Id: Ifaa6c90b59febb6bb168d2d2a389e56d3f0fc45b
diff --git a/test/Android.run-test.bp.py b/test/Android.run-test.bp.py
index 51c7d8d..b483f6c 100755
--- a/test/Android.run-test.bp.py
+++ b/test/Android.run-test.bp.py
@@ -34,7 +34,7 @@
         name = "art-run-test-{mode}-data-shard{shard}".format(mode=mode, shard=shard)
         names.append(name)
         f.write(textwrap.dedent("""
-          java_genrule {{
+          java_genrule_host {{
               name: "{name}-tmp",
               out: ["{name}.zip"],
               srcs: ["?{shard}-*/**/*", "??{shard}-*/**/*"],
@@ -68,9 +68,18 @@
                 "hiddenapi",
                 "jasmin",
                 "smali",
+                "soong_zip",
+                "zipalign",
             ],
             cmd: "$(location run_test_build.py) --out $(out) --mode {mode} " +
-                "--bootclasspath $(location :art-run-test-bootclasspath) $(in)",
+                 "--bootclasspath $(location :art-run-test-bootclasspath) " +
+                 "--d8 $(location d8) " +
+                 "--hiddenapi $(location hiddenapi) " +
+                 "--jasmin $(location jasmin) " +
+                 "--smali $(location smali) " +
+                 "--soong_zip $(location soong_zip) " +
+                 "--zipalign $(location zipalign) " +
+                 "$(in)",
         }}
         """).format(mode=mode))
 
@@ -78,7 +87,7 @@
       srcs = ("\n"+" "*8).join('":{}-tmp",'.format(n) for n in names)
       deps = ("\n"+" "*8).join('"{}",'.format(n) for n in names)
       f.write(textwrap.dedent("""
-        java_genrule {{
+        java_genrule_host {{
             name: "{name}-tmp",
             defaults: ["art_module_source_build_genrule_defaults"],
             out: ["{name}.zip"],
@@ -107,7 +116,7 @@
       deps = ("\n"+" "*8).join('"{}",'.format(n) for n in names)
       f.write(textwrap.dedent("""
         // Phony target used to build all shards
-        java_genrule {{
+        java_genrule_host {{
             name: "{name}-tmp",
             defaults: ["art-run-test-data-defaults"],
             out: ["{name}.txt"],