Add core-libart-for-test

For use by robolectric and layoutlib.

Bug: 185789034
Test: m robolectric_android-all-device-deps layoutlib
Change-Id: I292c5397b80bcbbbb118dccc54f69abeacbfbd1a
diff --git a/JavaLibrary.bp b/JavaLibrary.bp
index f58deeb..4cb1d81 100644
--- a/JavaLibrary.bp
+++ b/JavaLibrary.bp
@@ -287,10 +287,8 @@
     visibility: [
         "//art/build/apex",
         "//art/build/sdk",
-        "//external/robolectric-shadows",
         "//external/wycheproof",
         "//libcore/benchmarks",
-        "//frameworks/layoutlib",
         "//packages/modules/ArtPrebuilt",
     ],
     apex_available: [
@@ -334,6 +332,21 @@
     },
 }
 
+// Java library for use on host, e.g. by robolectric or layoutlib.
+java_library {
+    name: "core-libart-for-host",
+    visibility: [
+        "//art/build/sdk",
+        "//external/robolectric-shadows",
+        "//frameworks/layoutlib",
+    ],
+    static_libs: [
+        "core-libart",
+    ],
+    sdk_version: "none",
+    system_modules: "none",
+}
+
 // Provided solely to contribute information about which hidden parts of the
 // core-oj API are used by apps.
 //