Export tzdata in a jar for robolectric

Export the tzdata as files in a jar for robolectric.

Bug: 122331577
Test: m checkbuild
Change-Id: I2525087169669e57551650cc939c671f02e1083b
diff --git a/output_data/Android.bp b/output_data/Android.bp
index 94f4214..b7fbda5 100644
--- a/output_data/Android.bp
+++ b/output_data/Android.bp
@@ -46,3 +46,17 @@
     installable: false,
 }
 
+// tzdata packaged into a jar for use in robolectric
+java_genrule {
+    name: "robolectric_tzdata",
+    out: ["robolectric_tzdata.jar"],
+    tools: ["soong_zip"],
+    srcs: [
+        "iana/tzdata",
+        "android/tzlookup.xml",
+    ],
+    cmd: "mkdir -p $(genDir)/usr/share/zoneinfo/ && " +
+        "cp $(location iana/tzdata) $(genDir)/usr/share/zoneinfo/ && " +
+        "cp $(location android/tzlookup.xml) $(genDir)/usr/share/zoneinfo/ && " +
+        "$(location soong_zip) -o $(out) -C $(genDir) -D $(genDir)/usr/share/zoneinfo",
+}