DO NOT MERGE - Skip PPRL.190305.001 into master

Bug: 127812889
Change-Id: Iedbb71cdf75cda71fefc850c11664f6de0838a07
diff --git a/Android.mk b/Android.mk
index 888404c..1711bfd 100644
--- a/Android.mk
+++ b/Android.mk
@@ -1,3 +1,18 @@
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/OWNERS b/OWNERS
new file mode 100644
index 0000000..ac2cb6d
--- /dev/null
+++ b/OWNERS
@@ -0,0 +1,4 @@
+# Default code reviewers picked from top 3 or more developers.
+# Please update this list if you find better candidates.
+nfuller@google.com
+vichang@google.com
diff --git a/README.android b/README.android
index 127bd99..0a00001 100644
--- a/README.android
+++ b/README.android
@@ -117,24 +117,22 @@
 Changing the distro format version
 ----------------------------------
 
-1) Modify distro/core/src/main/com/android/timezone/distro/DistroVersion.java:
+1) Modify libcore/luni/src/main/java/libcore/timezone/TzDataSetVersion.java
   - CURRENT_FORMAT_MAJOR_VERSION, CURRENT_FORMAT_MINOR_VERSION
-2) Modify: tzdatacheck/tzdatacheck.cpp
-  - SUPPORTED_DISTRO_MAJOR_VERSION, SUPPORTED_DISTRO_MINOR_VERSION
-3) Run update-tzdata.py to regenerate the system/timezone/output_data,
+2) Run update-tzdata.py to regenerate the system/timezone/output_data,
   system/timezone/testing/data, external/icu runtime files and testing equivalents.
-4) Build/flash a device image with the changes and run CTS:
+3) Build/flash a device image with the changes and run CTS:
     cts-tradefed
     run cts -m CtsHostTzDataTests
     run cts -m CtsLibcoreTestCases
-5) Run non-CTS test cases:
+4) Run non-CTS test cases:
     make -j30 FrameworksServicesTests
     adb install -r -g \
         "${ANDROID_PRODUCT_OUT}/data/app/FrameworksServicesTests/FrameworksServicesTests.apk"
     adb shell am instrument -e package com.android.server.timezone -w \
         com.android.frameworks.servicestests \
         "com.android.frameworks.servicestests/android.support.test.runner.AndroidJUnitRunner"
-6) Upload, review, submit the changes from system/timezone.
+5) Upload, review, submit the changes from system/timezone, libcore and external/icu.
 
 REMINDER: Any prebuilt apks of OEM-specific time zone data apps .apk files
 (i.e. ones that that contain distro files) will also need to be regenerated
diff --git a/apex/Android.bp b/apex/Android.bp
new file mode 100644
index 0000000..f1459a1
--- /dev/null
+++ b/apex/Android.bp
@@ -0,0 +1,58 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Defaults shared between real and test versions of the APEX.
+apex_defaults {
+    name: "com.android.tzdata-defaults",
+
+    // Use a custom AndroidManifest.xml used for API targeting.
+    androidManifest: ":com.android.tzdata-androidManifest",
+
+    // Explicit because the defaulting behavior only works for the real
+    // module.
+    file_contexts: "com.android.tzdata",
+
+    // Shared signing information.
+    key: "apex.tzdata.key",
+    certificate: ":com.android.tzdata.certificate",
+}
+
+filegroup {
+    name: "com.android.tzdata-androidManifest",
+    srcs: ["AndroidManifest.xml"],
+}
+
+apex_key {
+    name: "apex.tzdata.key",
+    public_key: "com.android.tzdata.avbpubkey",
+    private_key: "com.android.tzdata.pem",
+}
+
+android_app_certificate {
+    name: "com.android.tzdata.certificate",
+    certificate: "com.android.tzdata",
+}
+
+// The definition for the real (not test) tzdata APEX.
+apex {
+    name: "com.android.tzdata",
+    defaults: ["com.android.tzdata-defaults"],
+    manifest: "manifest.json",
+    prebuilts: [
+        "apex_tz_version",
+        "apex_tzlookup.xml",
+        "apex_tzdata",
+        "apex_icu_tzdata.dat",
+    ],
+}
diff --git a/apex/AndroidManifest.xml b/apex/AndroidManifest.xml
new file mode 100644
index 0000000..980d723
--- /dev/null
+++ b/apex/AndroidManifest.xml
@@ -0,0 +1,27 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ * Copyright (C) 2017 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+  package="com.android.tzdata">
+  <!-- APEX does not have classes.dex -->
+  <application android:hasCode="false" />
+  <!--
+    *  The content of the time zone data module is tied to (among other things)
+    *  the version of ICU being used on the device. Since that typically
+    *  updates every dessert release, we lock the module to a single API level.
+    -->
+  <uses-sdk android:minSdkVersion="28" android:maxSdkVersion="28" />
+</manifest>
diff --git a/apex/com.android.tzdata.avbpubkey b/apex/com.android.tzdata.avbpubkey
new file mode 100644
index 0000000..932091d
--- /dev/null
+++ b/apex/com.android.tzdata.avbpubkey
Binary files differ
diff --git a/apex/com.android.tzdata.pem b/apex/com.android.tzdata.pem
new file mode 100644
index 0000000..54e230f
--- /dev/null
+++ b/apex/com.android.tzdata.pem
@@ -0,0 +1,51 @@
+-----BEGIN RSA PRIVATE KEY-----
+MIIJJwIBAAKCAgEA5v5DXTp4uMYwEtOWBDT3sYo7NB1xHI65eeShmA8qn11E6vOJ
+bNfLt7smcvs3tfRli/1TlEwewnrshZJAfdexfpGLBzRW08ifHrZCFsWoGWm8cS5o
+qiN492DNaUNSRbGgK5atDzoz3xOwSlXGLgh8ychdVahQWThxLdVsj4auiMkb2/Rw
+PIEzIRbbI7QnVvEWGXpofV4cSgoTFMZtbnMpL33yxFolt/to/re+CYl1Bmj2zdpH
+cFNYPCU9lLJsLY/2IfhWHBrvAlsny3Z3oqJzkVEZo6d3bpMWD2zPqvdkeLe1NgSQ
+4tfZgMYTYM+bOGLKyZUWyUlderl69zRSA4rHxiFW3UIHAV1orrprjIrhrigVjAOG
+YBk1I8n7dwRhwWTvmvlTsa2/9gQmA7JMI50dbd6aNVm7ZpQ+vLQ7g8qobe403iwn
+IDxiIzPSLE9Ci2AiallOv6OfVApHfnOtFrBm7Xkx9IxQlyFjmd/NvnElNufZ/REM
+qKk/Wvlvxx9/m0ZaxtCOdLd8ShYgMIO28aDLh2IcSOpc9AAPuHp0/XoqoFlKdjK3
+qarUszqkjtFYITutqQe9KXSKOO2U8lmSedAXnB7TWWv6yyR+L9z3LfNoYTqB4HkS
+Wfefk1bi7ZU0YgIDS2aw9yrxh9HSAYMkKgxbrpPtWJK7EjhLPqtynP8lUTUCAwEA
+AQKCAgAj3PAahlx9249VLPKKnqqiLuL4OWX5WBNl4GBSWnB0o6dyjvMUKgDf+reC
+fIxuvI4TiPYz/Ql9ilY0ert2jklpbDFYogClCu3hd8yU+oUZxPfT3q+zUqSSS744
+jJI2bdh/S/p8db3d8ZGaSOzm8rxlG62aAfLPl1rDEfKz6eYpKIghwza1vh1xErpd
+Nbgx4GZc+EtGw5jCygOiYxhUYJ7RV82cPJ7EjM0FVwOzOVso7pz64tvajaYSWHnS
+H016WXKOXZ8I6AmZpQttpGv4nR4yPpQre3Gogj+Xj35CffxkXalNxLG19ms3eglC
+K5lezL/NQk9yWuifiDKWNNJS6HYRekxFs0azfEf8FziSApPDS93fNuz4KfMBwSde
+6DzxdClrA+uptS/azUPOWFj7xjZLFCcDpq8r+W4MY8oTgRhApSByGrLxHpVan81f
+aFoJ5tYcvEDXVSYqUn32Mkne5VqM/h/6U3xQ2hf8kgI841+t1ANbuJRX1CZ37IFb
+5VqifN+MzZX6FMueYsLPNr2Ss0qXaJp+nFUgUd+YvuC9gr7Hkik/Wx7f16M89h90
+9yBYeROdYapbtO6Mjhh4P3kB/G8E6qIMOWOFchWFQQqTO5FxqfoMgP1sL0xWhApP
+2DwjzVJd8GYEanWDpZVIxi5wmAMCkadMEs9M4+020RNt/eYPAQKCAQEA+bgIYFeF
+Jq00iUhF6agBFud97Ln2R4TkvQrJ0S5db5abNWDXkrI9RQZ1y9uYi1R5V2MB/QXX
+Nln8eXk9gnilFXEMNtTjdoOx6NHdVA3bSeiDdYc2FSVv9WvbwnmifO5oTivNE20H
+uAPNUcdwjl2eBmBZgTkC2JoaL3uHGG12K5sKEWfJSRIMaQk/TMm1SFsvljvEegBG
+bu78ku9OwhFfe4tkSeppYL7u/da4gCvXmxP4JGXARMkqbckj1Nkc6PBqXCucGk0p
+7IecyEgIIXIINXC9Lgde20yW7cOLOngKTTNyWbZws4rfTqaQ56Sm48QjFd+A05Lm
+oPT2NxLiWFGBQQKCAQEA7M2nYQioPmTrJ2JlUidwPYHPRTapGQl+xqp6vU5eklKA
+4GMfufK5v/0R9acpceSy82ZnuiG0fMOR3UDyPogNJVLY5hLDly+NXgWjGNuduS9r
+zJ412bdekUpr6ciSIq2SwzDQTq4P6sZO4dYgQYRQp62557uvdsR/49yKIVMCuTqg
+HIymewcOit4U+lKEgcTWOBDxwx5xDs19eKGTKDP3DJK5vZJT+f/psPS06lzUrKZP
+QueRDrAWNP7lvggNCPFEsHDE6AON5+fl3gQ0r5oukJWxN9KeZ3aKlB/3PF5LcSDH
+skdrAVQJk3mTsYhZW1/NMV7jmB/zWn+NKI/B3T8e9QKCAQBgVFae24QYrF4EyyV1
+AgMRk9EmvYG8iw41wnChydHvVtiembHu++TYuKo+LoLE1JxOUnoU4ejoJYRYU6Wf
+q+x6vfYpPKxWLm0106ceYo4CD7iOYM9DDwMGWEoY1hURPmJsLUdZxAhjOsw8TMQl
+lwV7jjVYvOZVKfUJ9gviJ2+bWJ5konWqQ1UYO6H4fCL7O3m66WlcarjA2F4ETF5E
+TLFZlibkwJFP6beFogvgHYl5YBWr7LhjkHpWiW3SEMKvNPbCgWwhVTzj6lhXhjnk
+tPlnrAq+M8eqrvvV0kXmEyJeL4dgBhmpmNuVmnlxcjmSyTmDmYk3lIZ09qn4CsfX
+q/FBAoIBABe5ivl3ypNlvQGXJBuVA/PFm6SNk2eEwgTZc66fuW3jgjH4/Ga+4MlR
+a4k3FDnq9drY+a92TQTq+yQ1q4+ERfzlTgHPA3WUOA+hdPO6nRS+oYhAmZiUfI8F
+68XiaHG8/iU8MMKRQdr9v011DIpD3WjPSP7kmPHHQiDsKZKpJG62ZvA1T0CoNlbH
+ZUanGct+kw/O8snftOgMwnNhjMLMYgYKdT1++Zbkgt9NxQpt/ojFqM9FMA1Oqwro
+NtBRMi0hLwaWZcPxBziizS7vMPAe/GdT+AtluKUZBU1N3pFXySsuY5ODAD+D0enK
+lneE957l/ELkBN1q5hC9EsFrlbq65jkCggEAczfsroQpAUknZWCuClrxmxH7WGy+
+InwDfmE8s74DaF9qH4NJA73ju7X8HEhqWRu1z7nfqJhPzQGp0ic6P8cwuynwceSx
+oHMJEYSSnpU99l6C/qHS7N30+OuVb5MFlbrQj65Haglg2MxaW9exNdE/Y3tVKKfg
+j/Ln1jgEbt6zkBpBz+9kHSRMY9Bs+SXMEqOTYfVtHfEvNGNkkcWOTbl7T3ep8lfk
+bTdA/5m/MnaOzznGPBbUsxWI/cC/ODtlVyY231iGMyeK6gWHJGJo81+aoT93WEbA
+++tuCuob3VIV4IZnn/m31KtajMDpFRxYbCJsqiR2K1sWckSHY+1mjHjPKQ==
+-----END RSA PRIVATE KEY-----
diff --git a/apex/com.android.tzdata.pk8 b/apex/com.android.tzdata.pk8
new file mode 100644
index 0000000..f786710
--- /dev/null
+++ b/apex/com.android.tzdata.pk8
Binary files differ
diff --git a/apex/com.android.tzdata.x509.pem b/apex/com.android.tzdata.x509.pem
new file mode 100644
index 0000000..bf78bee
--- /dev/null
+++ b/apex/com.android.tzdata.x509.pem
@@ -0,0 +1,34 @@
+-----BEGIN CERTIFICATE-----
+MIIFzjCCA7agAwIBAgIJAIyjs8l5WRp5MA0GCSqGSIb3DQEBCwUAMHsxCzAJBgNV
+BAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYDVQQHDA1Nb3VudGFpbiBW
+aWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdBbmRyb2lkMRswGQYDVQQD
+DBJjb20uYW5kcm9pZC50emRhdGEwIBcNMTkwMTI1MTY0ODE0WhgPNDc1NjEyMjEx
+NjQ4MTRaMHsxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMRYwFAYD
+VQQHDA1Nb3VudGFpbiBWaWV3MRAwDgYDVQQKDAdBbmRyb2lkMRAwDgYDVQQLDAdB
+bmRyb2lkMRswGQYDVQQDDBJjb20uYW5kcm9pZC50emRhdGEwggIiMA0GCSqGSIb3
+DQEBAQUAA4ICDwAwggIKAoICAQC3PzY5waM71QpWUVQPfTrtCf9Mx9097DjM6RlD
+jaOd2FtN7gUN/d+z19h0WRkBcBMDWH3z4aHIDp4YXABIdqIzXehhdCFLro4W6H4I
+TNcbH6/M4rmtGs2v0zCkrr8z/mEasCdsw9iz8LOiyouGxgt0Q2qPSQ3OcbZSGX0C
+T8VNxDIP1RpQdRUKhZt/hsmcuPHGq64yil/i7FHX4dLgjnik4sUkHPsQTam/H/J/
+brl9OToTCyRuTgaq6EfxCZVXPfxQE6KTDchFr4wYSbxIgSN9zk2wPLXCsyvSb2lV
+fDSbkRmS89cCaCArF3SP3FAKoZdxdNtT1Q/KayMs7c/jrhFloiIpkstNCzMrPT9i
+j5QwRqcBscSijqaEJOyK458EhaO7m3GHc9e+1afsxTIn//vbrpJU7ewOiwcAsJAT
+KGFMotbK1fV4jGCzKxDVBd1OP5yN/iPYS8INH4tt1W1Q5jaQn/Uy+RuS1tPZTtrL
+ldj/QJ/K9XNSg4v12hXlLDwUlwEMu2Akbe6BYItfhdAEITRr332l6e466cQDp3V2
+mOWANPEX35s5/CaxeqJOi3Y+DSx4iwjOKiormnnEalRFAZrSDU2UNxIqrmidl03Y
+/0p13ugbPmJbpXFPZFDPsUuvPuGLSAU2luUuFSgT0FVyWj5BfzFmcuLxQom03+ds
+cX8GxQIDAQABo1MwUTAdBgNVHQ4EFgQUVCZf+AGkP1wMi7C0l6FFefk9kVAwHwYD
+VR0jBBgwFoAUVCZf+AGkP1wMi7C0l6FFefk9kVAwDwYDVR0TAQH/BAUwAwEB/zAN
+BgkqhkiG9w0BAQsFAAOCAgEAc0NA+Ya/L5Vs+8CZ/5rP6dIbzbgL7tm1nmjU65jY
+8znsSrB0JDTEHCLc+9u35YU77Z3sW9lFE9el1i693gYQnYSy1lducHHKzbnss2/f
++DJ4QExrPR+PfnkSxdjL8+MXVAtVZDCeEBTcUgLES6m4WLS9hKL4+Oe+igXkAJA+
+d8w1/5ASuood3cTNy3nxssdueAKl4Tyj0y0zejoVlznaYw4zMTmlnrz1l0ZbaKiM
+tr52U2kASEVQW6EhiielsLMzDngqAQ49FQriv7oUhrlbmP3+CkhhPWbM3keSHm/a
+vIQGD3+mbJpekuRgC5w1nCborCxpnHoZUXMyb6/3PnY9u4O8VT5rY5NipVfL/Cvu
+12w0kvcuXTP58gvOJANB5t8Jo4tctG99hO0ECr7/439YM4NMkL5nYEcJe3DemquB
+pB7xVBAD7WKEcB5KV/oDXoLjxMlassKSAvBVbx+fvbGIW6k1pe3uiHl8p/zvxoNb
+9FFRoElCyuzzVP5r/kN5uNbPVIexbVET4elOcUhKigHWZHYv/PQ9ncpA8tbDeAIr
+vzoofKWv4r4tyQZLR4YnEYTGBORO6rX//Mcg8zKE6vXb0zKLW5vW1zxv31q1p2lC
+0R5e4ix7UjR8OJcBCnyKuqSRdCIpMitam2V+BXwh/7mLZBA4LuV4koNofVaBFxlt
+BCo=
+-----END CERTIFICATE-----
diff --git a/apex/manifest.json b/apex/manifest.json
new file mode 100644
index 0000000..a088815
--- /dev/null
+++ b/apex/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "com.android.tzdata",
+  "version": 1
+}
diff --git a/distro/core/Android.bp b/distro/core/Android.bp
index 2adff01..67536da 100644
--- a/distro/core/Android.bp
+++ b/distro/core/Android.bp
@@ -18,17 +18,22 @@
 // This is distinct from time_zone_distro_unbundled. It should be used
 // for platform code as it avoids circular dependencies when stubs targets
 // need to build framework (as appears to be the case in aosp/master).
-// Also used for host-side tests.
-java_library_static {
+// Also used from host-side tests and tools.
+java_library {
     name: "time_zone_distro",
     host_supported: true,
 
     srcs: ["src/main/**/*.java"],
+    target: {
+        host: {
+            static_libs: ["timezone-host"],
+        },
+    },
 }
 
 // Library of classes for handling time zone distros. Used in unbundled
 // cases. Same as above, except dependent on system_current stubs.
-java_library_static {
+java_library {
     name: "time_zone_distro_unbundled",
 
     srcs: ["src/main/**/*.java"],
@@ -36,12 +41,13 @@
 }
 
 // Tests for time_zone_distro code.
-java_library_static {
+java_library {
     name: "time_zone_distro-tests",
 
     srcs: ["src/test/**/*.java"],
     static_libs: [
         "time_zone_distro",
+        "core-tests-support",
         "junit",
     ],
 }
diff --git a/distro/core/src/main/com/android/timezone/distro/DistroVersion.java b/distro/core/src/main/com/android/timezone/distro/DistroVersion.java
index 5d87d28..a3ead3f 100644
--- a/distro/core/src/main/com/android/timezone/distro/DistroVersion.java
+++ b/distro/core/src/main/com/android/timezone/distro/DistroVersion.java
@@ -26,27 +26,11 @@
  */
 public class DistroVersion {
 
-    /**
-     * The major distro format version supported by this device.
-     * Increment this for non-backwards compatible changes to the distro format. Reset the minor
-     * version to 1 when doing so.
-     * This constant must match the one in system/core/tzdatacheck/tzdatacheck.cpp.
-     */
-    public static final int CURRENT_FORMAT_MAJOR_VERSION = 2;
-
-    /**
-     * The minor distro format version supported by this device. Increment this for
-     * backwards-compatible changes to the distro format.
-     * This constant must match the one in system/core/tzdatacheck/tzdatacheck.cpp.
-     */
-    public static final int CURRENT_FORMAT_MINOR_VERSION = 1;
-
-    /** The full major + minor distro format version for this device. */
-    private static final String FULL_CURRENT_FORMAT_VERSION_STRING =
-            toFormatVersionString(CURRENT_FORMAT_MAJOR_VERSION, CURRENT_FORMAT_MINOR_VERSION);
+    /** An example major + minor distro format version string. */
+    private static final String SAMPLE_FORMAT_VERSION_STRING = toFormatVersionString(1, 1);
 
     private static final int FORMAT_VERSION_STRING_LENGTH =
-            FULL_CURRENT_FORMAT_VERSION_STRING.length();
+            SAMPLE_FORMAT_VERSION_STRING.length();
     private static final Pattern FORMAT_VERSION_PATTERN = Pattern.compile("(\\d{3})\\.(\\d{3})");
 
     /** A pattern that matches the IANA rules value of a rules update. e.g. "2016g" */
@@ -124,11 +108,6 @@
                 .getBytes(StandardCharsets.US_ASCII);
     }
 
-    public static boolean isCompatibleWithThisDevice(DistroVersion distroVersion) {
-        return (CURRENT_FORMAT_MAJOR_VERSION == distroVersion.formatMajorVersion)
-                && (CURRENT_FORMAT_MINOR_VERSION <= distroVersion.formatMinorVersion);
-    }
-
     @Override
     public boolean equals(Object o) {
         if (this == o) {
diff --git a/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java b/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java
index a21b261..27dca1d 100644
--- a/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java
+++ b/distro/core/src/main/com/android/timezone/distro/TimeZoneDistro.java
@@ -21,8 +21,6 @@
 import java.io.FileOutputStream;
 import java.io.IOException;
 import java.io.InputStream;
-import java.util.Arrays;
-import java.util.function.Supplier;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipInputStream;
 
diff --git a/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java b/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java
index a4d96c5..7f54e84 100644
--- a/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java
+++ b/distro/core/src/test/com/android/timezone/distro/DistroVersionTest.java
@@ -63,38 +63,6 @@
         assertEquals(distroVersion, DistroVersion.fromBytes(distroVersion.toBytes()));
     }
 
-    public void testIsCompatibleWithThisDevice() throws Exception {
-        DistroVersion exactMatch = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION);
-        assertTrue(DistroVersion.isCompatibleWithThisDevice(exactMatch));
-
-        DistroVersion newerMajor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION + 1,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION);
-        assertFalse(DistroVersion.isCompatibleWithThisDevice(newerMajor));
-
-        DistroVersion newerMinor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION + 1);
-        assertTrue(DistroVersion.isCompatibleWithThisDevice(newerMinor));
-
-        // The constant versions should never be below 1. We allow 0 but want to start version
-        // numbers at 1 to allow testing of older version logic.
-        assertTrue(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION >= 1);
-        assertTrue(DistroVersion.CURRENT_FORMAT_MINOR_VERSION >= 1);
-
-        DistroVersion olderMajor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION - 1,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION);
-        assertFalse(DistroVersion.isCompatibleWithThisDevice(olderMajor));
-
-        DistroVersion olderMinor = createDistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION - 1);
-        assertFalse(DistroVersion.isCompatibleWithThisDevice(olderMinor));
-    }
-
     private DistroVersion createDistroVersion(int majorFormatVersion, int minorFormatVersion)
             throws DistroException {
         return new DistroVersion(majorFormatVersion, minorFormatVersion, VALID_RULES_VERSION, 3);
diff --git a/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java b/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java
index 8606009..6b51a4d 100644
--- a/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java
+++ b/distro/core/src/test/com/android/timezone/distro/FileUtilsTest.java
@@ -21,6 +21,8 @@
 import android.system.OsConstants;
 import android.system.StructStat;
 
+import libcore.testing.io.TestIoUtils;
+
 import java.io.File;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
@@ -30,7 +32,6 @@
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.List;
-import libcore.io.IoUtils;
 
 /**
  * Tests for {@link FileUtils}.
@@ -344,7 +345,7 @@
 
     private File createTempDir() {
         final String tempPrefix = getClass().getSimpleName();
-        File tempDir = IoUtils.createTemporaryDirectory(tempPrefix);
+        File tempDir = TestIoUtils.createTemporaryDirectory(tempPrefix);
         testFiles.add(tempDir);
         return tempDir;
     }
diff --git a/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java b/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java
index ce3669e..ac6d825 100644
--- a/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java
+++ b/distro/core/src/test/com/android/timezone/distro/TimeZoneDistroTest.java
@@ -17,6 +17,9 @@
 
 import junit.framework.TestCase;
 
+import libcore.testing.io.TestIoUtils;
+import libcore.timezone.TzDataSetVersion;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.File;
@@ -27,10 +30,8 @@
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
-import java.util.function.Supplier;
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
-import libcore.io.IoUtils;
 
 /**
  * Tests for {@link TimeZoneDistro}.
@@ -50,8 +51,9 @@
     }
 
     public void testGetDistroVersion() throws Exception {
-        DistroVersion distroVersion = new DistroVersion(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION, "2016c", 1);
+        DistroVersion distroVersion = new DistroVersion(
+                TzDataSetVersion.currentFormatMajorVersion(),
+                TzDataSetVersion.currentFormatMinorVersion(), "2016c", 1);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (ZipOutputStream zipOutputStream = new ZipOutputStream(baos)) {
             addZipEntry(zipOutputStream, TimeZoneDistro.DISTRO_VERSION_FILE_NAME,
@@ -63,8 +65,8 @@
     }
 
     public void testGetDistroVersion_closesStream() throws Exception {
-        DistroVersion distroVersion = new DistroVersion(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION, "2016c", 1);
+        DistroVersion distroVersion = new DistroVersion(
+                3 /* majorVersion */, 2 /* minorVersion */, "2016c", 1);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (ZipOutputStream zipOutputStream = new ZipOutputStream(baos)) {
             addZipEntry(zipOutputStream, TimeZoneDistro.DISTRO_VERSION_FILE_NAME,
@@ -79,8 +81,8 @@
     }
 
     public void testExtractTo_closesStream() throws Exception {
-        DistroVersion distroVersion = new DistroVersion(DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION, "2016c", 1);
+        DistroVersion distroVersion = new DistroVersion(
+                3 /* majorVersion */, 2 /* minorVersion */, "2016c", 1);
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
         try (ZipOutputStream zipOutputStream = new ZipOutputStream(baos)) {
             addZipEntry(zipOutputStream, TimeZoneDistro.DISTRO_VERSION_FILE_NAME,
@@ -166,7 +168,7 @@
 
     private File createTempDir() {
         final String tempPrefix = getClass().getSimpleName();
-        File tempDir = IoUtils.createTemporaryDirectory(tempPrefix);
+        File tempDir = TestIoUtils.createTemporaryDirectory(tempPrefix);
         testFiles.add(tempDir);
         return tempDir;
     }
diff --git a/distro/installer/Android.bp b/distro/installer/Android.bp
index 8750f91..75c1939 100644
--- a/distro/installer/Android.bp
+++ b/distro/installer/Android.bp
@@ -13,7 +13,7 @@
 // limitations under the License.
 
 // The classes needed to handle installation of time zone distros.
-java_library_static {
+java_library {
     name: "time_zone_distro_installer",
 
     srcs: ["src/main/**/*.java"],
@@ -21,13 +21,13 @@
 }
 
 // Tests for time_zone_distro_installer code
-java_library_static {
+java_library {
     name: "time_zone_distro_installer-tests",
 
     srcs: ["src/test/**/*.java"],
     static_libs: [
         "time_zone_distro",
-        "time_zone_distro_tools",
+        "time_zone_distro_builder",
         "time_zone_distro_installer",
         "tzdata-testing",
         "junit",
diff --git a/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java b/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java
index 68c9715..6c33bd7 100644
--- a/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java
+++ b/distro/installer/src/main/com/android/timezone/distro/installer/TimeZoneDistroInstaller.java
@@ -29,8 +29,10 @@
 import java.io.IOException;
 import java.lang.annotation.Retention;
 import java.lang.annotation.RetentionPolicy;
-import libcore.util.TimeZoneFinder;
-import libcore.util.ZoneInfoDB;
+import libcore.timezone.TzDataSetVersion;
+import libcore.timezone.TzDataSetVersion.TzDataSetException;
+import libcore.timezone.TimeZoneFinder;
+import libcore.timezone.ZoneInfoDB;
 
 /**
  * A distro-validation / extraction class. Separate from the services code that uses it for easier
@@ -110,15 +112,15 @@
     public static final String UNINSTALL_TOMBSTONE_FILE_NAME = "STAGED_UNINSTALL_TOMBSTONE";
 
     private final String logTag;
-    private final File systemTzDataFile;
+    private final File baseVersionFile;
     private final File oldStagedDataDir;
     private final File stagedTzDataDir;
     private final File currentTzDataDir;
     private final File workingDir;
 
-    public TimeZoneDistroInstaller(String logTag, File systemTzDataFile, File installDir) {
+    public TimeZoneDistroInstaller(String logTag, File baseVersionFile, File installDir) {
         this.logTag = logTag;
-        this.systemTzDataFile = systemTzDataFile;
+        this.baseVersionFile = baseVersionFile;
         oldStagedDataDir = new File(installDir, OLD_TZ_DATA_DIR_NAME);
         stagedTzDataDir = new File(installDir, STAGED_TZ_DATA_DIR_NAME);
         currentTzDataDir = new File(installDir, CURRENT_TZ_DATA_DIR_NAME);
@@ -175,7 +177,19 @@
                 Slog.i(logTag, "Update not applied: Distro version could not be loaded");
                 return INSTALL_FAIL_BAD_DISTRO_STRUCTURE;
             }
-            if (!DistroVersion.isCompatibleWithThisDevice(distroVersion)) {
+
+            // The TzDataSetVersion class replaces the DistroVersion class after P. Convert to the
+            // new class so we can use the isCompatibleWithThisDevice() method.
+            TzDataSetVersion distroTzDataSetVersion;
+            try {
+                distroTzDataSetVersion = new TzDataSetVersion(
+                        distroVersion.formatMajorVersion, distroVersion.formatMinorVersion,
+                        distroVersion.rulesVersion, distroVersion.revision);
+            } catch (TzDataSetException e) {
+                Slog.i(logTag, "Update not applied: Distro version could not be converted", e);
+                return INSTALL_FAIL_BAD_DISTRO_STRUCTURE;
+            }
+            if (!TzDataSetVersion.isCompatibleWithThisDevice(distroTzDataSetVersion)) {
                 Slog.i(logTag, "Update not applied: Distro format version check failed: "
                         + distroVersion);
                 return INSTALL_FAIL_BAD_DISTRO_FORMAT_VERSION;
@@ -186,7 +200,7 @@
                 return INSTALL_FAIL_BAD_DISTRO_STRUCTURE;
             }
 
-            if (!checkDistroRulesNewerThanSystem(systemTzDataFile, distroVersion)) {
+            if (!checkDistroRulesNewerThanBase(baseVersionFile, distroVersion)) {
                 Slog.i(logTag, "Update not applied: Distro rules version check failed");
                 return INSTALL_FAIL_RULES_TOO_OLD;
             }
@@ -251,7 +265,7 @@
 
     /**
      * Stage an uninstall of the current timezone update in /data which, on reboot, will return the
-     * device to using data from /system. If there was something else already staged it will be
+     * device to using the base data. If there was something else already staged it will be
      * removed by this call.
      *
      * Returns {@link #UNINSTALL_SUCCESS} if staging the uninstallation was
@@ -339,13 +353,26 @@
     }
 
     /**
-     * Reads the timezone rules version present in /system. i.e. the version that would be present
-     * after a factory reset.
+     * Reads the base time zone rules version. i.e. the version that would be present after an
+     * installed update is removed.
      *
      * @throws IOException if there was a problem reading data
      */
-    public String getSystemRulesVersion() throws IOException {
-        return readSystemRulesVersion(systemTzDataFile);
+    public TzDataSetVersion readBaseVersion() throws IOException {
+        return readBaseVersion(baseVersionFile);
+    }
+
+    private TzDataSetVersion readBaseVersion(File baseVersionFile) throws IOException {
+        if (!baseVersionFile.exists()) {
+            Slog.i(logTag, "version file cannot be found in " + baseVersionFile);
+            throw new FileNotFoundException(
+                    "base version file does not exist: " + baseVersionFile);
+        }
+        try {
+            return TzDataSetVersion.readFromFile(baseVersionFile);
+        } catch (TzDataSetException e) {
+            throw new IOException("Unable to read: " + baseVersionFile, e);
+        }
     }
 
     private void deleteBestEffort(File dir) {
@@ -384,34 +411,27 @@
     }
 
     /**
-     * Returns true if the the distro IANA rules version is >= system IANA rules version.
+     * Returns true if the the distro IANA rules version is >= base IANA rules version.
      */
-    private boolean checkDistroRulesNewerThanSystem(
-            File systemTzDataFile, DistroVersion distroVersion) throws IOException {
+    private boolean checkDistroRulesNewerThanBase(
+            File baseVersionFile, DistroVersion distroVersion) throws IOException {
 
-        // We only check the /system tzdata file and assume that other data like ICU is in sync.
-        // There is a CTS test that checks ICU and bionic/libcore are in sync.
-        Slog.i(logTag, "Reading /system rules version");
-        String systemRulesVersion = readSystemRulesVersion(systemTzDataFile);
+        // We only check the base tz_version file and assume that data like ICU is in sync.
+        // There is a CTS test that checks tz_version, ICU and bionic/libcore are in sync.
+        Slog.i(logTag, "Reading base time zone rules version");
+        TzDataSetVersion baseVersion = readBaseVersion(baseVersionFile);
 
+        String baseRulesVersion = baseVersion.rulesVersion;
         String distroRulesVersion = distroVersion.rulesVersion;
-        // canApply = distroRulesVersion >= systemRulesVersion
-        boolean canApply = distroRulesVersion.compareTo(systemRulesVersion) >= 0;
+        // canApply = distroRulesVersion >= baseRulesVersion
+        boolean canApply = distroRulesVersion.compareTo(baseRulesVersion) >= 0;
         if (!canApply) {
             Slog.i(logTag, "Failed rules version check: distroRulesVersion="
-                    + distroRulesVersion + ", systemRulesVersion=" + systemRulesVersion);
+                    + distroRulesVersion + ", baseRulesVersion=" + baseRulesVersion);
         } else {
             Slog.i(logTag, "Passed rules version check: distroRulesVersion="
-                    + distroRulesVersion + ", systemRulesVersion=" + systemRulesVersion);
+                    + distroRulesVersion + ", baseRulesVersion=" + baseRulesVersion);
         }
         return canApply;
     }
-
-    private String readSystemRulesVersion(File systemTzDataFile) throws IOException {
-        if (!systemTzDataFile.exists()) {
-            Slog.i(logTag, "tzdata file cannot be found in /system");
-            throw new FileNotFoundException("system tzdata does not exist: " + systemTzDataFile);
-        }
-        return ZoneInfoDB.TzData.getRulesVersion(systemTzDataFile);
-    }
 }
diff --git a/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java b/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java
index ab8f512..50bea96 100644
--- a/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java
+++ b/distro/installer/src/test/com/android/timezone/distro/installer/TimeZoneDistroInstallerTest.java
@@ -19,7 +19,7 @@
 import com.android.timezone.distro.FileUtils;
 import com.android.timezone.distro.StagedDistroOperation;
 import com.android.timezone.distro.TimeZoneDistro;
-import com.android.timezone.distro.tools.TimeZoneDistroBuilder;
+import com.android.timezone.distro.builder.TimeZoneDistroBuilder;
 
 import junit.framework.TestCase;
 
@@ -38,7 +38,8 @@
 import java.util.zip.ZipEntry;
 import java.util.zip.ZipOutputStream;
 import libcore.io.IoUtils;
-import libcore.tzdata.testing.ZoneInfoTestHelper;
+import libcore.timezone.TzDataSetVersion;
+import libcore.timezone.testing.ZoneInfoTestHelper;
 
 import static org.junit.Assert.assertArrayEquals;
 
@@ -47,31 +48,36 @@
  */
 public class TimeZoneDistroInstallerTest extends TestCase {
 
-    // OLDER_RULES_VERSION < SYSTEM_RULES_VERSION < NEW_RULES_VERSION < NEWER_RULES_VERSION
+    // OLDER_RULES_VERSION < BASE_RULES_VERSION < NEW_RULES_VERSION < NEWER_RULES_VERSION
     private static final String OLDER_RULES_VERSION = "2030a";
-    private static final String SYSTEM_RULES_VERSION = "2030b";
+    private static final String BASE_RULES_VERSION = "2030b";
     private static final String NEW_RULES_VERSION = "2030c";
     private static final String NEWER_RULES_VERSION = "2030d";
 
     private TimeZoneDistroInstaller installer;
     private File tempDir;
     private File testInstallDir;
-    private File testSystemTzDataDir;
+    private File testBaseDataDir;
 
     @Override
     public void setUp() throws Exception {
         super.setUp();
         tempDir = createUniqueDirectory(null, "tempDir");
         testInstallDir = createSubDirectory(tempDir, "testInstall");
-        testSystemTzDataDir =  createSubDirectory(tempDir, "testSystemTzData");
+        testBaseDataDir =  createSubDirectory(tempDir, "testBaseData");
 
-        // Create a file to represent the tzdata file in the /system partition of the device.
-        File testSystemTzDataFile = new File(testSystemTzDataDir, "tzdata");
-        byte[] systemTzDataBytes = createTzData(SYSTEM_RULES_VERSION);
-        createFile(testSystemTzDataFile, systemTzDataBytes);
+        // Create a tz_version file to indicate the base version of tz data on a device.
+        TzDataSetVersion tzDataSetVersion =
+                new TzDataSetVersion(
+                        TzDataSetVersion.currentFormatMajorVersion(),
+                        TzDataSetVersion.currentFormatMinorVersion(),
+                        BASE_RULES_VERSION,
+                        1 /* revision */);
+        File testBaseVersionFile = new File(testBaseDataDir, TzDataSetVersion.DEFAULT_FILE_NAME);
+        createFile(testBaseVersionFile, tzDataSetVersion.toBytes());
 
         installer = new TimeZoneDistroInstaller(
-                "TimeZoneDistroInstallerTest", testSystemTzDataFile, testInstallDir);
+                "TimeZoneDistroInstallerTest", testBaseVersionFile, testInstallDir);
     }
 
     /**
@@ -99,15 +105,15 @@
         super.tearDown();
     }
 
-    /** Tests the an update on a device will fail if the /system tzdata file cannot be found. */
-    public void testStageInstallWithErrorCode_badSystemFile() throws Exception {
-        File doesNotExist = new File(testSystemTzDataDir, "doesNotExist");
-        TimeZoneDistroInstaller brokenSystemInstaller = new TimeZoneDistroInstaller(
+    /** Tests the an update on a device will fail if the base tz_version file cannot be found. */
+    public void testStageInstallWithErrorCode_badBaseFile() throws Exception {
+        File doesNotExist = new File(testBaseDataDir, "doesNotExist");
+        TimeZoneDistroInstaller brokenBaseInstaller = new TimeZoneDistroInstaller(
                 "TimeZoneDistroInstallerTest", doesNotExist, testInstallDir);
         byte[] distroBytes = createValidTimeZoneDistroBytes(NEW_RULES_VERSION, 1);
 
         try {
-            brokenSystemInstaller.stageInstallWithErrorCode(new TimeZoneDistro(distroBytes));
+            brokenBaseInstaller.stageInstallWithErrorCode(new TimeZoneDistro(distroBytes));
             fail();
         } catch (IOException expected) {}
 
@@ -127,11 +133,11 @@
     }
 
     /**
-     * Tests we can install an update the same version as is in /system.
+     * Tests we can install an update with the same version as the base version.
      */
-    public void testStageInstallWithErrorCode_successfulFirstUpdate_sameVersionAsSystem()
+    public void testStageInstallWithErrorCode_successfulFirstUpdate_sameVersionAsBase()
             throws Exception {
-        byte[] distroBytes = createValidTimeZoneDistroBytes(SYSTEM_RULES_VERSION, 1);
+        byte[] distroBytes = createValidTimeZoneDistroBytes(BASE_RULES_VERSION, 1);
         assertEquals(
                 TimeZoneDistroInstaller.INSTALL_SUCCESS,
                 installer.stageInstallWithErrorCode(new TimeZoneDistro(distroBytes)));
@@ -140,9 +146,9 @@
     }
 
     /**
-     * Tests we cannot install an update older than the version in /system.
+     * Tests we cannot install an update older than the base version.
      */
-    public void testStageInstallWithErrorCode_unsuccessfulFirstUpdate_olderVersionThanSystem()
+    public void testStageInstallWithErrorCode_unsuccessfulFirstUpdate_olderVersionThanBase()
             throws Exception {
         byte[] distroBytes = createValidTimeZoneDistroBytes(OLDER_RULES_VERSION, 1);
         assertEquals(
@@ -179,7 +185,7 @@
 
     /**
      * Tests an update on a device when there is a prior update already applied, but the follow
-     * on update is older than in /system.
+     * on update is older than the base version.
      */
     public void testStageInstallWithErrorCode_unsuccessfulFollowOnUpdate_olderVersion()
             throws Exception {
@@ -333,8 +339,8 @@
         // Create a distro that will appear to be newer than the one currently supported.
         byte[] distroBytes = createValidTimeZoneDistroBuilder(NEW_RULES_VERSION, 1)
                 .replaceFormatVersionForTests(
-                        DistroVersion.CURRENT_FORMAT_MAJOR_VERSION + 1,
-                        DistroVersion.CURRENT_FORMAT_MINOR_VERSION)
+                        TzDataSetVersion.currentFormatMajorVersion() + 1,
+                        TzDataSetVersion.currentFormatMinorVersion())
                 .buildUnvalidatedBytes();
         assertEquals(
                 TimeZoneDistroInstaller.INSTALL_FAIL_BAD_DISTRO_FORMAT_VERSION,
@@ -493,8 +499,9 @@
         assertInstalledDistro(installedDistroBytes);
     }
 
-    public void testGetSystemRulesVersion() throws Exception {
-        assertEquals(SYSTEM_RULES_VERSION, installer.getSystemRulesVersion());
+    public void testReadBaseRulesVersion() throws Exception {
+        TzDataSetVersion actualBaseVersion = installer.readBaseVersion();
+        assertEquals(BASE_RULES_VERSION, actualBaseVersion.rulesVersion);
     }
 
     public void testGetInstalledDistroVersion() throws Exception {
@@ -597,8 +604,8 @@
                 + "  </countryzones>\n"
                 + "</timezones>\n";
         DistroVersion distroVersion = new DistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION,
+                TzDataSetVersion.currentFormatMajorVersion(),
+                TzDataSetVersion.currentFormatMinorVersion(),
                 rulesVersion,
                 revision);
         return new TimeZoneDistroBuilder()
diff --git a/distro/tools/Android.bp b/distro/tools/Android.bp
index 8d9d9b1..0495983 100644
--- a/distro/tools/Android.bp
+++ b/distro/tools/Android.bp
@@ -12,15 +12,24 @@
 // See the License for the specific language governing permissions and
 // limitations under the License.
 
-// Library of tools classes for creating / interpreting time zone distros.
-// Used when generating distros and in host-side tests.
-java_library_static {
-    name: "time_zone_distro_tools",
-    host_supported: true,
+// The tool used to create time zone distro.zip files.
+java_library_host {
+    name: "create_time_zone_distro",
 
     srcs: ["src/main/**/*.java"],
     libs: [
         "time_zone_distro",
     ],
+}
+
+// Code that can build a time zone distro.zip. Used in tests.
+java_library {
+    name: "time_zone_distro_builder",
+    host_supported: true,
+
+    srcs: ["src/main/**/builder/*.java"],
+    libs: [
+        "time_zone_distro",
+    ],
     no_framework_libs: true,
 }
diff --git a/distro/tools/create-distro.py b/distro/tools/create-distro.py
index 90899fe..fa15004 100755
--- a/distro/tools/create-distro.py
+++ b/distro/tools/create-distro.py
@@ -16,6 +16,8 @@
 
 """Generates a time zone distro file"""
 
+from __future__ import print_function
+
 import argparse
 import os
 import shutil
@@ -31,12 +33,12 @@
 timezone_dir = os.path.realpath('%s/system/timezone' % android_build_top)
 i18nutil.CheckDirExists(timezone_dir, 'system/timezone')
 
-def RunCreateTimeZoneDistro(properties_file, distro_output_dir):
+def RunCreateTimeZoneDistro(properties_file):
   # Build the libraries needed.
-  subprocess.check_call(['make', '-C', android_build_top, 'time_zone_distro_tools',
+  subprocess.check_call(['make', '-C', android_build_top, 'create_time_zone_distro',
       'time_zone_distro'])
 
-  libs = [ 'time_zone_distro_tools', 'time_zone_distro' ]
+  libs = [ 'create_time_zone_distro', 'time_zone_distro' ]
   host_java_libs_dir = '%s/../common/obj/JAVA_LIBRARIES' % android_host_out_dir
   classpath_components = []
   for lib in libs:
@@ -46,11 +48,12 @@
 
   # Run the CreateTimeZoneDistro tool
   subprocess.check_call(['java', '-cp', classpath,
-      'com.android.timezone.distro.tools.CreateTimeZoneDistro', properties_file,
-      distro_output_dir])
+      'com.android.timezone.distro.tools.CreateTimeZoneDistro', properties_file])
 
 
-def CreateTimeZoneDistro(iana_version, revision, tzdata_file, icu_file, tzlookup_file, output_dir):
+def CreateTimeZoneDistro(
+    iana_version, revision, tzdata_file, icu_file, tzlookup_file, output_distro_dir,
+    output_version_file):
   original_cwd = os.getcwd()
 
   i18nutil.SwitchToNewTemporaryDirectory()
@@ -64,8 +67,10 @@
     properties.write('tzdata.file=%s\n' % tzdata_file)
     properties.write('icu.file=%s\n' % icu_file)
     properties.write('tzlookup.file=%s\n' % tzlookup_file)
+    properties.write('output.distro.dir=%s\n' % output_distro_dir)
+    properties.write('output.version.file=%s\n' % output_version_file)
 
-  RunCreateTimeZoneDistro(properties_file, output_dir)
+  RunCreateTimeZoneDistro(properties_file)
 
   os.chdir(original_cwd)
 
@@ -81,7 +86,10 @@
       help='The location of the ICU overlay .dat file to include')
   parser.add_argument('-tzlookup', required=True,
       help='The location of the tzlookup.xml file to include')
-  parser.add_argument('-output', required=True, help='The output directory')
+  parser.add_argument('-output_distro_dir', required=True,
+      help='The output directory for the distro.zip')
+  parser.add_argument('-output_version_file', required=True,
+      help='The output path for the version file')
   args = parser.parse_args()
 
   iana_version = args.iana_version
@@ -89,7 +97,8 @@
   tzdata_file = os.path.abspath(args.tzdata)
   icu_file = os.path.abspath(args.icu)
   tzlookup_file = os.path.abspath(args.tzlookup)
-  output_dir = os.path.abspath(args.output)
+  output_distro_dir = os.path.abspath(args.output_distro_dir)
+  output_version_file = os.path.abspath(args.output_version_file)
 
   CreateTimeZoneDistro(
       iana_version=iana_version,
@@ -97,9 +106,11 @@
       tzdata_file=tzdata_file,
       icu_file=icu_file,
       tzlookup_file=tzlookup_file,
-      output_dir=output_dir)
+      output_distro_dir=output_distro_dir,
+      output_version_file=output_version_file)
 
-  print 'Distro files created in %s' % output_dir
+  print('Distro file created in %s' % output_distro_dir)
+  print('Version file created as %s' % output_version_file)
   sys.exit(0)
 
 
diff --git a/distro/tools/src/main/com/android/timezone/distro/tools/TimeZoneDistroBuilder.java b/distro/tools/src/main/com/android/timezone/distro/builder/TimeZoneDistroBuilder.java
similarity index 99%
rename from distro/tools/src/main/com/android/timezone/distro/tools/TimeZoneDistroBuilder.java
rename to distro/tools/src/main/com/android/timezone/distro/builder/TimeZoneDistroBuilder.java
index ed21aeb..4540608 100644
--- a/distro/tools/src/main/com/android/timezone/distro/tools/TimeZoneDistroBuilder.java
+++ b/distro/tools/src/main/com/android/timezone/distro/builder/TimeZoneDistroBuilder.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package com.android.timezone.distro.tools;
+package com.android.timezone.distro.builder;
 
 import com.android.timezone.distro.DistroException;
 import com.android.timezone.distro.DistroVersion;
diff --git a/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java b/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java
index b53b43e..06698ea 100644
--- a/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java
+++ b/distro/tools/src/main/com/android/timezone/distro/tools/CreateTimeZoneDistro.java
@@ -15,8 +15,11 @@
  */
 package com.android.timezone.distro.tools;
 
+import libcore.timezone.TzDataSetVersion;
+
 import com.android.timezone.distro.DistroVersion;
 import com.android.timezone.distro.TimeZoneDistro;
+import com.android.timezone.distro.builder.TimeZoneDistroBuilder;
 
 import java.io.File;
 import java.io.FileInputStream;
@@ -28,14 +31,13 @@
 import java.util.Properties;
 
 /**
- * A command-line tool for creating a time zone update distro file.
+ * A command-line tool for creating a time zone update distro and associated
+ * files.
  *
  * <p>Args:
  * <dl>
  *     <dt>input properties file</dt>
- *     <dd>the file describing the distro</dd>
- *     <dt>output dir</dt>
- *     <dd>the directory to generate files into</dd>
+ *     <dd>the file describing the distro and output dirs</dd>
  * </dl>
  *
  * <p>The input properties file must have the entries:
@@ -50,12 +52,17 @@
  *     <dd>The location of the ICU overlay .dat file.</dd>
  *     <dt>tzlookup.file</dt>
  *     <dd>The location of the tzlookup.xml file.</dd>
+ *     <dt>output.distro.dir</dt>
+ *     <dd>The directory to write the distro.zip file to.</dd>
+ *     <dt>output.version.file</dt>
+ *     <dd>The location to write the version file to.</dd>
  * </dl>
  *
  * <p>The output consists of:
  * <ul>
  *     <li>A distro .zip containing the input files. See
  *     {@link com.android.timezone.distro.TimeZoneDistro}</li>
+ *     <li>A version file (same as contained in the distro .zip).</li>
  * </ul>
  */
 public class CreateTimeZoneDistro {
@@ -63,7 +70,7 @@
     private CreateTimeZoneDistro() {}
 
     public static void main(String[] args) throws Exception {
-        if (args.length != 2) {
+        if (args.length != 1) {
             printUsage();
             System.exit(1);
         }
@@ -73,25 +80,42 @@
             printUsage();
             System.exit(2);
         }
-        Properties inputProperties = loadProperties(f);
-        String ianaRulesVersion = getMandatoryProperty(inputProperties, "rules.version");
-        int revision = Integer.parseInt(getMandatoryProperty(inputProperties, "revision"));
-        DistroVersion distroVersion = new DistroVersion(
-                DistroVersion.CURRENT_FORMAT_MAJOR_VERSION,
-                DistroVersion.CURRENT_FORMAT_MINOR_VERSION,
+        Properties properties = loadProperties(f);
+        String ianaRulesVersion = getMandatoryProperty(properties, "rules.version");
+        int revision = Integer.parseInt(getMandatoryProperty(properties, "revision"));
+
+        // Create an object to hold version metadata for the tz data.
+        TzDataSetVersion tzDataSetVersion = new TzDataSetVersion(
+                TzDataSetVersion.currentFormatMajorVersion(),
+                TzDataSetVersion.currentFormatMinorVersion(),
                 ianaRulesVersion,
                 revision);
+        byte[] tzDataSetVersionBytes = tzDataSetVersion.toBytes();
+
+        // Create a DistroVersion from the TzDataSetVersion.
+        DistroVersion distroVersion = new DistroVersion(
+                tzDataSetVersion.formatMajorVersion,
+                tzDataSetVersion.formatMinorVersion,
+                tzDataSetVersion.rulesVersion,
+                tzDataSetVersion.revision);
         TimeZoneDistroBuilder builder = new TimeZoneDistroBuilder()
                 .setDistroVersion(distroVersion)
-                .setTzDataFile(getMandatoryPropertyFile(inputProperties, "tzdata.file"))
-                .setIcuDataFile(getMandatoryPropertyFile(inputProperties, "icu.file"))
-                .setTzLookupFile(getMandatoryPropertyFile(inputProperties, "tzlookup.file"));
-
+                .setTzDataFile(getMandatoryPropertyFile(properties, "tzdata.file"))
+                .setIcuDataFile(getMandatoryPropertyFile(properties, "icu.file"))
+                .setTzLookupFile(getMandatoryPropertyFile(properties, "tzlookup.file"));
         byte[] distroBytes = builder.buildBytes();
 
+        File outputDistroDir = getMandatoryPropertyFile(properties, "output.distro.dir");
+        File outputVersionFile = new File(getMandatoryProperty(properties, "output.version.file"));
+
+        // Write the tz data set version file.
+        try (OutputStream os = new FileOutputStream(outputVersionFile)) {
+            os.write(tzDataSetVersionBytes);
+        }
+        System.out.println("Wrote " + outputVersionFile);
+
         // Write the distro file.
-        File outputDir = new File(args[1]);
-        File outputDistroFile = new File(outputDir, TimeZoneDistro.FILE_NAME);
+        File outputDistroFile = new File(outputDistroDir, TimeZoneDistro.FILE_NAME);
         try (OutputStream os = new FileOutputStream(outputDistroFile)) {
             os.write(distroBytes);
         }
@@ -131,6 +155,6 @@
     private static void printUsage() {
         System.out.println("Usage:");
         System.out.println("\t" + CreateTimeZoneDistro.class.getName() +
-                " <tzupdate.properties file> <output dir>");
+                " <tzupdate.properties file>");
     }
 }
diff --git a/distro/tools/tzupdate.properties b/distro/tools/tzupdate.properties
index 0770bd5..2bc30c3 100644
--- a/distro/tools/tzupdate.properties
+++ b/distro/tools/tzupdate.properties
@@ -6,6 +6,11 @@
 # This is used to indicate when Android has issued a revision. e.g. "1", "2".
 revision=1
 
+# Input files
 tzdata.file=
 icu.file=
 tzlookup.file=
+
+# Output locations
+output.distro.dir=
+output.version.file=
diff --git a/download-iana-data.py b/download-iana-data.py
index 6b9865b..1d33f5a 100755
--- a/download-iana-data.py
+++ b/download-iana-data.py
@@ -16,6 +16,8 @@
 
 """Downloads the latest IANA timezone data."""
 
+from __future__ import print_function
+
 import ftplib
 import os
 import shutil
@@ -35,22 +37,27 @@
 
 def CheckSignature(data_filename, signature_filename):
   """Checks the signature of a file."""
-  print 'Verifying signature...'
+  print('Verifying signature...')
   try:
     subprocess.check_call(['gpg', '--trusted-key=ED97E90E62AA7E34', '--verify',
                           signature_filename, data_filename])
   except subprocess.CalledProcessError as err:
-    print 'Unable to verify signature'
-    print '\n\n******'
-    print 'If this fails for you, you probably need to import Paul Eggert''s public key:'
-    print '  gpg --receive-keys ED97E90E62AA7E34'
-    print '******\n\n'
+    print('Unable to verify signature')
+    print('\n\n******')
+    print('If this fails for you, you probably need to import Paul Eggert''s public key:')
+    print('  gpg --receive-keys ED97E90E62AA7E34')
+    print('******\n\n')
     raise
 
 # Run with no arguments from any directory, with no special setup required.
 # See http://www.iana.org/time-zones/ for more about the source of this data.
 def main():
-  print 'Looking for new IANA tzdata...'
+  print('Looking for new IANA tzdata...')
+
+  tar_prefix = 'tzdata20'
+  # Use the input tzdata version name if it exists
+  if len(sys.argv) > 1:
+    tar_prefix = 'tzdata' + sys.argv[1]
 
   iana_tar_filenames = []
 
@@ -59,15 +66,15 @@
   ftp.cwd('tz/releases')
   for filename in ftp.nlst():
     if "/" in filename:
-      print "FTP server returned bogus file name"
+      print("FTP server returned bogus file name")
       sys.exit(1)
 
-    if filename.startswith('tzdata20') and filename.endswith('.tar.gz'):
+    if filename.startswith(tar_prefix) and filename.endswith('.tar.gz'):
       iana_tar_filenames.append(filename)
   iana_tar_filenames.sort(reverse=True)
 
   if len(iana_tar_filenames) == 0:
-    print 'No tzdata files found'
+    print('No tzdata files found')
     sys.exit(1)
 
   latest_iana_tar_filename = iana_tar_filenames[0]
@@ -77,17 +84,17 @@
   if local_iana_tar_file:
     local_iana_tar_filename = os.path.basename(local_iana_tar_file)
     if latest_iana_tar_filename <= local_iana_tar_filename:
-      print 'Available data %s is older or the same as current data %s' % (latest_iana_tar_filename, local_iana_tar_filename)
+      print('Available data %s is older or the same as current data %s' % (latest_iana_tar_filename, local_iana_tar_filename))
       sys.exit(0)
 
-  print 'Found new tzdata: %s' % latest_iana_tar_filename
+  print('Found new tzdata: %s' % latest_iana_tar_filename)
   i18nutil.SwitchToNewTemporaryDirectory()
 
-  print 'Downloading data (%s)...' % latest_iana_tar_filename
+  print('Downloading data (%s)...' % latest_iana_tar_filename)
   FtpRetrieveFile(ftp, latest_iana_tar_filename)
 
   signature_filename = '%s.asc' % latest_iana_tar_filename
-  print 'Downloading signature (%s)...' % signature_filename
+  print('Downloading signature (%s)...' % signature_filename)
   FtpRetrieveFile(ftp, signature_filename)
 
   CheckSignature(latest_iana_tar_filename, signature_filename)
@@ -105,7 +112,7 @@
   if os.path.exists(local_signature_file):
     os.remove(local_signature_file)
 
-  print 'Look in %s for new IANA data files' % new_local_iana_tar_file
+  print('Look in %s for new IANA data files' % new_local_iana_tar_file)
   sys.exit(0)
 
 
diff --git a/input_data/android/countryzones.txt b/input_data/android/countryzones.txt
index b6139e0..ca74897 100644
--- a/input_data/android/countryzones.txt
+++ b/input_data/android/countryzones.txt
@@ -25,7 +25,7 @@
 # a time zone for an Android device.
 
 # ianaVersion: The version of the IANA rules this file matches.
-ianaVersion:"2018g"
+ianaVersion:"2018i"
 
 # countries:
 #
@@ -1202,7 +1202,7 @@
 countries:<
   isoCode:"eh"
   timeZoneMappings:<
-    utcOffset:"1:00"
+    utcOffset:"0:00"
     id:"Africa/El_Aaiun"
   >
 >
@@ -1799,7 +1799,7 @@
 
 # KAZAKHSTAN
 #
-# Priorities assigned on 20180309 using:
+# Priorities assigned on 20190107 using:
 # https://en.wikipedia.org/wiki/List_of_cities_in_Kazakhstan
 # Priority is just an abstract score.
 countries:<
@@ -1812,8 +1812,7 @@
   >
   timeZoneMappings:<
     utcOffset:"6:00"
-    id:"Asia/Qyzylorda"
-    priority:1
+    id:"Asia/Qostanay"
   >
 
   timeZoneMappings:<
@@ -1827,6 +1826,11 @@
   >
   timeZoneMappings:<
     utcOffset:"5:00"
+    id:"Asia/Qyzylorda"
+    priority:1
+  >
+  timeZoneMappings:<
+    utcOffset:"5:00"
     id:"Asia/Aqtobe"
     priority:1
   >
@@ -1940,7 +1944,7 @@
 countries:<
   isoCode:"ma"
   timeZoneMappings:<
-    utcOffset:"1:00"
+    utcOffset:"0:00"
     id:"Africa/Casablanca"
   >
 >
@@ -2919,7 +2923,7 @@
 countries:<
   isoCode:"st"
   timeZoneMappings:<
-    utcOffset:"1:00"
+    utcOffset:"0:00"
     id:"Africa/Sao_Tome"
   >
 >
diff --git a/input_data/iana/tzdata2018g.tar.gz b/input_data/iana/tzdata2018g.tar.gz
deleted file mode 100644
index f366e3e..0000000
--- a/input_data/iana/tzdata2018g.tar.gz
+++ /dev/null
Binary files differ
diff --git a/input_data/iana/tzdata2018g.tar.gz.asc b/input_data/iana/tzdata2018g.tar.gz.asc
deleted file mode 100644
index 33e97df..0000000
--- a/input_data/iana/tzdata2018g.tar.gz.asc
+++ /dev/null
@@ -1,16 +0,0 @@
------BEGIN PGP SIGNATURE-----
-
-iQIzBAABCAAdFiEEfjeSqdis99YzvBWI7ZfpDmKqfjQFAlvT+vsACgkQ7ZfpDmKq
-fjSOeQ/+KHzhT6GWZeqOAKj/AjyKK9KnL4gPh4MhsiI+V3z3/y+4ECvvee7ixbHI
-NQ33B4gRBzlbWWYnHw4Yq6Fm9RihnHOVj8XT/BM56YFESdfTQxOHsqsY+n3byGND
-Q+luSH0YC/S4mLxqS/vxHyT+nU2D4sS6UCmMIzW62fixJX5S2HAC3s7WoQkRXRDg
-ItaQvU42r9qs67C4M8q2+A9H7anUIhIE5KqZcPKmF7AMAdGnY4ZWpKb/uyxwzi58
-pctIhzSGkB8im2m8QgDTrYsflOgADw3j/dKuYnyu4J0aniWC3qp7nJFPr5uTDaW7
-TsWtaZCaUhytlsg+E0zebTURV2ziVNf52X58U9K3kUnnZqOxxZUeQWACmdjCc0kO
-yg9P1idYz1XTC4c0oik/YTt5OMkpkyFNqTaueSSQ3dpD0vc63GbGrDbMSPfa6bOx
-EOHvR/IqcNKCewfnv7a8h7y+5JX52gijL5hZjkpAU/XBCMdA3Pd/vZ5n3UaSbnC1
-MNmZgsnJjBKVgaK8KHTuhCGigtDFc6TQethUQlKKWLr41P5RWrdmrhmMZIP0VBt5
-4X0Kf7mKK2X/lsI33FCpzUbtnV093L1bLe6Vt74r01JBWUxeEy2BHdn+KM/CqHkH
-LTj0FmVFUWzvG7kqzrRgjJ5CnLUSnf/T1Gl6PgeKzMePChptyQE=
-=kUHt
------END PGP SIGNATURE-----
diff --git a/input_data/iana/tzdata2018i.tar.gz b/input_data/iana/tzdata2018i.tar.gz
new file mode 100644
index 0000000..be28d0c
--- /dev/null
+++ b/input_data/iana/tzdata2018i.tar.gz
Binary files differ
diff --git a/input_data/iana/tzdata2018i.tar.gz.asc b/input_data/iana/tzdata2018i.tar.gz.asc
new file mode 100644
index 0000000..1fd503f
--- /dev/null
+++ b/input_data/iana/tzdata2018i.tar.gz.asc
@@ -0,0 +1,16 @@
+-----BEGIN PGP SIGNATURE-----
+
+iQIyBAABCgAdFiEEfjeSqdis99YzvBWI7ZfpDmKqfjQFAlwpGB8ACgkQ7ZfpDmKq
+fjTMog/3YJT5eFuwlijuTDxlt+VMTaAEaDaSUfzmQhaTDuHPKVDXxCaWq+tcO4J8
+gzzecRj40Xc/jZId7MREq2S3uyUu7D6tJR7kRMw8BeTYVkhf+wX4Xmfh+6bVB9bO
+34GNTSK9BXoieio68AkaCziVhBy6KynKhzUS4d1sqEDUxhS7r3ir6jTiU4UGAf54
+PKWh2YKYITuYww4XnseG9rQsKbVKK4GUm/e7OmV3zf5pI9lhf/TQh1XZXKFbKK70
+gDmFPUDAyuiFBCxkA7YsGolAnkscVmuF301brsNg+VKPy1qgMbxY/vF0lo/f7xRw
+dzi8+ek6/pKCIUmVRWCsg68wUDh1j3pAh9MLT8zhMtxOc42Kh+4b1BNq0x45zVbQ
+693ufcf056654Y27bCexy1JbGBNEd6UUGUv/Ou9EGrl6nfrfMSmUneqmBEnl8NY+
+6/cge/JOr+rVbmEku+nuC9kLZx63lSy4BXJ8+vv4DgzE6/3906V30+w/oJUGaImx
+PjE9tjm6biIWdRi6bZRdFcg0mktBEyzJuAuurX0ZRgcaNkrhNd4zw2Q3yuKDcD67
+aM5wUA4JVLX5v6P+s5j5Y+B+OY4sVk8fFzev8BJX+wRulqEmchVertypir17PUSr
+oqRUAww6oaYwenZNE+6dN0OWtpLDdBUv7+pesiYcaJRrXDCLAA==
+=ttI4
+-----END PGP SIGNATURE-----
diff --git a/output_data/Android.bp b/output_data/Android.bp
new file mode 100644
index 0000000..94f4214
--- /dev/null
+++ b/output_data/Android.bp
@@ -0,0 +1,48 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+prebuilt_etc {
+    name: "apex_tz_version",
+    src: "version/tz_version",
+    filename: "tz_version",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzlookup.xml",
+    src: "android/tzlookup.xml",
+    filename: "tzlookup.xml",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzdata",
+    src: "iana/tzdata",
+    notice: "iana/NOTICE",
+    filename: "tzdata",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_icu_tzdata.dat",
+    src: "icu_overlay/icu_tzdata.dat",
+    notice: "icu_overlay/LICENSE",
+    filename: "icu_tzdata.dat",
+    sub_dir: "icu",
+    installable: false,
+}
+
diff --git a/output_data/Android.mk b/output_data/Android.mk
index 888404c..1711bfd 100644
--- a/output_data/Android.mk
+++ b/output_data/Android.mk
@@ -1,3 +1,18 @@
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 LOCAL_PATH := $(call my-dir)
 
 include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/output_data/CleanSpec.mk b/output_data/CleanSpec.mk
new file mode 100644
index 0000000..2ceaf82
--- /dev/null
+++ b/output_data/CleanSpec.mk
@@ -0,0 +1,57 @@
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list.  These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list.  E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+$(call add-clean-step, rm -f $(TARGET_OUT)/system/usr/share/zoneinfo/tzlookup.xml)
+$(call add-clean-step, rm -f $(HOST_OUT)/usr/share/zoneinfo/tzlookup.xml)
+
+# Fixes for the steps above which seem to be broken because TARGET_OUT / HOST_OUT aren't set
+# for CleanSpec.mk.
+$(call add-clean-step, rm -f $(PRODUCT_OUT)/system/usr/share/zoneinfo/tzlookup.xml)
+$(call add-clean-step, rm -f $(OUT_DIR)/host/linux-x86/usr/share/zoneinfo/tzlookup.xml)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
diff --git a/output_data/android/Android.mk b/output_data/android/Android.mk
index 10f3caa..0da3b73 100644
--- a/output_data/android/Android.mk
+++ b/output_data/android/Android.mk
@@ -1,28 +1,34 @@
-LOCAL_PATH:= $(call my-dir)
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
 
-include $(CLEAR_VARS)
-LOCAL_MODULE := tzlookup.xml
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
-LOCAL_SRC_FILES := $(LOCAL_MODULE)
-LOCAL_MODULE_CLASS := ETC
-LOCAL_MODULE_TAGS := optional
-LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/share/zoneinfo
-include $(BUILD_PREBUILT)
+LOCAL_PATH:= $(call my-dir)
 
 ifeq ($(WITH_HOST_DALVIK),true)
 
 # A host version of the tzlookup.xml module for use by
 # hostdex rules.
 
+# Simulate the runtime module.
 include $(CLEAR_VARS)
-LOCAL_MODULE := tzlookup.xml
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_MODULE := tzlookup.xml_host_runtime_apex
 LOCAL_IS_HOST_MODULE := true
 LOCAL_SRC_FILES := tzlookup.xml
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
-LOCAL_MODULE_PATH := $(HOST_OUT)/usr/share/zoneinfo
+LOCAL_MODULE_PATH := $(HOST_OUT)/com.android.runtime/etc/tz
 include $(BUILD_PREBUILT)
 
 endif
diff --git a/output_data/android/tzlookup.xml b/output_data/android/tzlookup.xml
index 7e0fc27..3a553fb 100644
--- a/output_data/android/tzlookup.xml
+++ b/output_data/android/tzlookup.xml
@@ -2,7 +2,7 @@
 
  **** Autogenerated file - DO NOT EDIT ****
 
---><timezones ianaversion="2018g">
+--><timezones ianaversion="2018i">
  <countryzones>
   <country code="ad" default="Europe/Andorra" everutc="n">
    <id>Europe/Andorra</id>
@@ -465,10 +465,11 @@
   </country>
   <country code="kz" default="Asia/Almaty" everutc="n">
    <id>Asia/Almaty</id>
-   <id notafter="1099170000000">Asia/Qyzylorda</id>
+   <id notafter="1099170000000">Asia/Qostanay</id>
    <id notafter="1099173600000">Asia/Aqtau</id>
    <id>Asia/Oral</id>
-   <id>Asia/Aqtobe</id>
+   <id notafter="1545328800000">Asia/Qyzylorda</id>
+   <id notafter="1545328800000">Asia/Aqtobe</id>
    <id notafter="922572000000">Asia/Atyrau</id>
   </country>
   <country code="la" default="Asia/Vientiane" everutc="n">
@@ -524,7 +525,7 @@
   </country>
   <country code="mh" default="Pacific/Majuro" everutc="n">
    <id>Pacific/Majuro</id>
-   <id notafter="745848000000">Pacific/Kwajalein</id>
+   <id notafter="745934400000">Pacific/Kwajalein</id>
   </country>
   <country code="mk" default="Europe/Skopje" everutc="n">
    <id>Europe/Skopje</id>
@@ -868,7 +869,7 @@
    <id notafter="436359600000">America/Juneau</id>
    <id notafter="436356000000">America/Yakutat</id>
    <id notafter="436363200000">America/Nome</id>
-   <id notafter="1446372000000">America/Metlakatla</id>
+   <id notafter="1552215600000">America/Metlakatla</id>
    <id notafter="341402400000">America/Sitka</id>
    <id>Pacific/Honolulu</id>
    <id>America/Adak</id>
diff --git a/output_data/distro/distro.zip b/output_data/distro/distro.zip
index 72cf3ca..399e86f 100644
--- a/output_data/distro/distro.zip
+++ b/output_data/distro/distro.zip
Binary files differ
diff --git a/output_data/iana/Android.mk b/output_data/iana/Android.mk
index 5aafd17..f7995e9 100644
--- a/output_data/iana/Android.mk
+++ b/output_data/iana/Android.mk
@@ -1,8 +1,22 @@
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
 LOCAL_PATH:= $(call my-dir)
 
 include $(CLEAR_VARS)
 LOCAL_MODULE := tzdata
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
 LOCAL_SRC_FILES := $(LOCAL_MODULE)
 LOCAL_MODULE_CLASS := ETC
 LOCAL_MODULE_TAGS := optional
@@ -14,9 +28,9 @@
 # A host version of the tzdata module for use by
 # hostdex rules.
 
+# Simulate /system
 include $(CLEAR_VARS)
-LOCAL_MODULE := tzdata
-LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_MODULE := tzdata_host
 LOCAL_IS_HOST_MODULE := true
 LOCAL_SRC_FILES := tzdata
 LOCAL_MODULE_CLASS := ETC
@@ -25,4 +39,15 @@
 LOCAL_MODULE_PATH := $(HOST_OUT)/usr/share/zoneinfo
 include $(BUILD_PREBUILT)
 
+# Simulate the runtime module.
+include $(CLEAR_VARS)
+LOCAL_MODULE := tzdata_host_runtime_apex
+LOCAL_IS_HOST_MODULE := true
+LOCAL_SRC_FILES := tzdata
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
+LOCAL_MODULE_PATH := $(HOST_OUT)/com.android.runtime/etc/tz
+include $(BUILD_PREBUILT)
+
 endif
diff --git a/output_data/iana/tzdata b/output_data/iana/tzdata
index ebe66d2..6c55cd8 100644
--- a/output_data/iana/tzdata
+++ b/output_data/iana/tzdata
Binary files differ
diff --git a/output_data/icu_overlay/LICENSE b/output_data/icu_overlay/LICENSE
new file mode 100644
index 0000000..25b6eb9
--- /dev/null
+++ b/output_data/icu_overlay/LICENSE
@@ -0,0 +1,414 @@
+COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
+
+Copyright © 1991-2018 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
+
+---------------------
+
+Third-Party Software Licenses
+
+This section contains third-party software notices and/or additional
+terms for licensed third-party software components included within ICU
+libraries.
+
+1. ICU License - ICU 1.8.1 to ICU 57.1
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2016 International Business Machines Corporation and others
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the
+property of their respective owners.
+
+2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ #     The Google Chrome software developed by Google is licensed under
+ # the BSD license. Other software included in this distribution is
+ # provided under other licenses, as set forth below.
+ #
+ #  The BSD License
+ #  http://opensource.org/licenses/bsd-license.php
+ #  Copyright (C) 2006-2008, Google Inc.
+ #
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are met:
+ #
+ #  Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #  Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following
+ # disclaimer in the documentation and/or other materials provided with
+ # the distribution.
+ #  Neither the name of  Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
+ #
+ #  The word list in cjdict.txt are generated by combining three word lists
+ # listed below with further processing for compound word breaking. The
+ # frequency is generated with an iterative training against Google web
+ # corpora.
+ #
+ #  * Libtabe (Chinese)
+ #    - https://sourceforge.net/project/?group_id=1519
+ #    - Its license terms and conditions are shown below.
+ #
+ #  * IPADIC (Japanese)
+ #    - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ #    - Its license terms and conditions are shown below.
+ #
+ #  ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ #  /*
+ #   * Copyright (c) 1999 TaBE Project.
+ #   * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ #   * All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the TaBE Project nor the names of its
+ #   *   contributors may be used to endorse or promote products derived
+ #   *   from this software without specific prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  /*
+ #   * Copyright (c) 1999 Computer Systems and Communication Lab,
+ #   *                    Institute of Information Science, Academia
+ #       *                    Sinica. All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the Computer Systems and Communication Lab
+ #   *   nor the names of its contributors may be used to endorse or
+ #   *   promote products derived from this software without specific
+ #   *   prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  Copyright 1996 Chih-Hao Tsai @ Beckman Institute,
+ #      University of Illinois
+ #  c-tsai4@uiuc.edu  http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ #  ---------------COPYING.libtabe-----END--------------------------------
+ #
+ #
+ #  ---------------COPYING.ipadic-----BEGIN-------------------------------
+ #
+ #  Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ #  and Technology.  All Rights Reserved.
+ #
+ #  Use, reproduction, and distribution of this software is permitted.
+ #  Any copy of this software, whether in its original form or modified,
+ #  must include both the above copyright notice and the following
+ #  paragraphs.
+ #
+ #  Nara Institute of Science and Technology (NAIST),
+ #  the copyright holders, disclaims all warranties with regard to this
+ #  software, including all implied warranties of merchantability and
+ #  fitness, in no event shall NAIST be liable for
+ #  any special, indirect or consequential damages or any damages
+ #  whatsoever resulting from loss of use, data or profits, whether in an
+ #  action of contract, negligence or other tortuous action, arising out
+ #  of or in connection with the use or performance of this software.
+ #
+ #  A large portion of the dictionary entries
+ #  originate from ICOT Free Software.  The following conditions for ICOT
+ #  Free Software applies to the current dictionary as well.
+ #
+ #  Each User may also freely distribute the Program, whether in its
+ #  original form or modified, to any third party or parties, PROVIDED
+ #  that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ #  on, or be attached to, the Program, which is distributed substantially
+ #  in the same form as set out herein and that such intended
+ #  distribution, if actually made, will neither violate or otherwise
+ #  contravene any of the laws and regulations of the countries having
+ #  jurisdiction over the User or the intended distribution itself.
+ #
+ #  NO WARRANTY
+ #
+ #  The program was produced on an experimental basis in the course of the
+ #  research and development conducted during the project and is provided
+ #  to users as so produced on an experimental basis.  Accordingly, the
+ #  program is provided without any warranty whatsoever, whether express,
+ #  implied, statutory or otherwise.  The term "warranty" used herein
+ #  includes, but is not limited to, any warranty of the quality,
+ #  performance, merchantability and fitness for a particular purpose of
+ #  the program and the nonexistence of any infringement or violation of
+ #  any right of any third party.
+ #
+ #  Each user of the program will agree and understand, and be deemed to
+ #  have agreed and understood, that there is no warranty whatsoever for
+ #  the program and, accordingly, the entire risk arising from or
+ #  otherwise connected with the program is assumed by the user.
+ #
+ #  Therefore, neither ICOT, the copyright holder, or any other
+ #  organization that participated in or was otherwise related to the
+ #  development of the program and their respective officials, directors,
+ #  officers and other employees shall be held liable for any and all
+ #  damages, including, without limitation, general, special, incidental
+ #  and consequential damages, arising out of or otherwise in connection
+ #  with the use or inability to use the program or any product, material
+ #  or result produced or otherwise obtained by using the program,
+ #  regardless of whether they have been advised of, or otherwise had
+ #  knowledge of, the possibility of such damages at any time during the
+ #  project or thereafter.  Each user will be deemed to have agreed to the
+ #  foregoing by his or her commencement of use of the program.  The term
+ #  "use" as used herein includes, but is not limited to, the use,
+ #  modification, copying and distribution of the program and the
+ #  production of secondary products from the program.
+ #
+ #  In the case where the program, whether in its original form or
+ #  modified, was distributed or delivered to or received by a user from
+ #  any person, organization or entity other than ICOT, unless it makes or
+ #  grants independently of ICOT any specific warranty to the user in
+ #  writing, such person, organization or entity, will also be exempted
+ #  from and not be held liable to the user for any such damages as noted
+ #  above as far as the program is concerned.
+ #
+ #  ---------------COPYING.ipadic-----END----------------------------------
+
+3. Lao Word Break Dictionary Data (laodict.txt)
+
+ #  Copyright (c) 2013 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ # Project: http://code.google.com/p/lao-dictionary/
+ # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
+ #              (copied below)
+ #
+ #  This file is derived from the above dictionary, with slight
+ #  modifications.
+ #  ----------------------------------------------------------------------
+ #  Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification,
+ #  are permitted provided that the following conditions are met:
+ #
+ #
+ # Redistributions of source code must retain the above copyright notice, this
+ #  list of conditions and the following disclaimer. Redistributions in
+ #  binary form must reproduce the above copyright notice, this list of
+ #  conditions and the following disclaimer in the documentation and/or
+ #  other materials provided with the distribution.
+ #
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ #  Copyright (c) 2014 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ #  This list is part of a project hosted at:
+ #    github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ #  --------------------------------------------------------------------------
+ #  Copyright (c) 2013, LeRoy Benjamin Sharon
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification, are permitted provided that the following conditions
+ #  are met: Redistributions of source code must retain the above
+ #  copyright notice, this list of conditions and the following
+ #  disclaimer.  Redistributions in binary form must reproduce the
+ #  above copyright notice, this list of conditions and the following
+ #  disclaimer in the documentation and/or other materials provided
+ #  with the distribution.
+ #
+ #    Neither the name Myanmar Karen Word Lists, nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ #  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ #  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ #  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ #  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ #  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ #  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ #  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ #  SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+5. Time Zone Database
+
+  ICU uses the public domain data and code derived from Time Zone
+Database for its time zone support. The ownership of the TZ database
+is explained in BCP 175: Procedure for Maintaining the Time Zone
+Database section 7.
+
+ # 7.  Database Ownership
+ #
+ #    The TZ database itself is not an IETF Contribution or an IETF
+ #    document.  Rather it is a pre-existing and regularly updated work
+ #    that is in the public domain, and is intended to remain in the
+ #    public domain.  Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do
+ #    not apply to the TZ Database or contributions that individuals make
+ #    to it.  Should any claims be made and substantiated against the TZ
+ #    Database, the organization that is providing the IANA
+ #    Considerations defined in this RFC, under the memorandum of
+ #    understanding with the IETF, currently ICANN, may act in accordance
+ #    with all competent court orders.  No ownership claims will be made
+ #    by ICANN or the IETF Trust on the database or the code.  Any person
+ #    making a contribution to the database or code waives all rights to
+ #    future claims in that contribution or in the TZ Database.
+
+6. Google double-conversion
+
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/output_data/icu_overlay/icu_tzdata.dat b/output_data/icu_overlay/icu_tzdata.dat
index 284af9e..d63dd36 100644
--- a/output_data/icu_overlay/icu_tzdata.dat
+++ b/output_data/icu_overlay/icu_tzdata.dat
Binary files differ
diff --git a/output_data/version/Android.mk b/output_data/version/Android.mk
new file mode 100644
index 0000000..3ff89a1
--- /dev/null
+++ b/output_data/version/Android.mk
@@ -0,0 +1,53 @@
+# -*- mode: makefile -*-
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#      http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+LOCAL_PATH:= $(call my-dir)
+
+include $(CLEAR_VARS)
+LOCAL_MODULE := tz_version
+LOCAL_SRC_FILES := $(LOCAL_MODULE)
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_PATH := $(TARGET_OUT)/usr/share/zoneinfo
+include $(BUILD_PREBUILT)
+
+ifeq ($(WITH_HOST_DALVIK),true)
+
+# A host version of the tz_version module for use by
+# hostdex rules.
+
+# Simulate /system
+include $(CLEAR_VARS)
+LOCAL_MODULE := tz_version_host
+LOCAL_IS_HOST_MODULE := true
+LOCAL_SRC_FILES := tz_version
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
+LOCAL_MODULE_PATH := $(HOST_OUT)/usr/share/zoneinfo
+include $(BUILD_PREBUILT)
+
+# Simulate the runtime module
+include $(CLEAR_VARS)
+LOCAL_MODULE := tz_version_host_runtime_apex
+LOCAL_IS_HOST_MODULE := true
+LOCAL_SRC_FILES := tz_version
+LOCAL_MODULE_CLASS := ETC
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_STEM := $(LOCAL_SRC_FILES)
+LOCAL_MODULE_PATH := $(HOST_OUT)/com.android.runtime/etc/tz
+include $(BUILD_PREBUILT)
+
+endif
diff --git a/output_data/version/tz_version b/output_data/version/tz_version
new file mode 100644
index 0000000..099c584
--- /dev/null
+++ b/output_data/version/tz_version
@@ -0,0 +1 @@
+003.001|2018i|001
\ No newline at end of file
diff --git a/testing/Android.bp b/testing/Android.bp
index 108bd8d..75cc274 100644
--- a/testing/Android.bp
+++ b/testing/Android.bp
@@ -19,5 +19,5 @@
     hostdex: true,
 
     srcs: ["src/main/**/*.java"],
-    no_framework_libs: true,
+    sdk_version: "core_current",
 }
diff --git a/testing/data/create-test-data.sh b/testing/data/create-test-data.sh
index 53a5eea..2d3dce2 100755
--- a/testing/data/create-test-data.sh
+++ b/testing/data/create-test-data.sh
@@ -31,13 +31,15 @@
 
 # Create the distro .zip
 mkdir -p ${TEST_DIR}/output_data/distro
+mkdir -p ${TEST_DIR}/output_data/version
 ${DISTRO_TOOLS_DIR}/create-distro.py \
     -iana_version ${IANA_VERSION} \
     -revision 1 \
     -tzdata ${TEST_DIR}/output_data/iana/tzdata \
     -icu ${TEST_DIR}/output_data/icu_overlay/icu_tzdata.dat \
     -tzlookup ${TEST_DIR}/output_data/android/tzlookup.xml \
-    -output ${TEST_DIR}/output_data/distro
+    -output_distro_dir ${TEST_DIR}/output_data/distro \
+    -output_version_file ${TEST_DIR}/output_data/version/tz_version
 
 # Test 2: A set of data older than the system-image data from ${TIMEZONE_DIR}
 IANA_VERSION=2016a
@@ -48,12 +50,14 @@
 
 # Create the distro .zip
 mkdir -p ${TEST_DIR}/output_data/distro
+mkdir -p ${TEST_DIR}/output_data/version
 ${DISTRO_TOOLS_DIR}/create-distro.py \
     -iana_version ${IANA_VERSION} \
     -revision 1 \
     -tzdata ${TEST_DIR}/output_data/iana/tzdata \
     -icu ${TEST_DIR}/output_data/icu_overlay/icu_tzdata.dat \
     -tzlookup ${TEST_DIR}/output_data/android/tzlookup.xml \
-    -output ${TEST_DIR}/output_data/distro
+    -output_distro_dir ${TEST_DIR}/output_data/distro \
+    -output_version_file ${TEST_DIR}/output_data/version/tz_version
 
 
diff --git a/testing/data/test1/apex/Android.bp b/testing/data/test1/apex/Android.bp
new file mode 100644
index 0000000..c405f63
--- /dev/null
+++ b/testing/data/test1/apex/Android.bp
@@ -0,0 +1,34 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// A test version of apex.tzdata that contains test1 data (2030a).
+// It has a version code that should beat a "real" APEX and enables
+// end-to-end installation testing on devices with the latests real
+// data.
+apex {
+    name: "test1_com.android.tzdata",
+    defaults: ["com.android.tzdata-defaults"],
+    manifest: "manifest.json",
+    prebuilts: [
+        "apex_tz_version_test1",
+        "apex_tzlookup.xml_test1",
+        "apex_tzdata_test1",
+        "apex_icu_tzdata.dat_test1",
+    ],
+
+    // installable: false as we do not want test APEX versions in the system
+    // image.
+    installable: false,
+}
+
diff --git a/testing/data/test1/apex/manifest.json b/testing/data/test1/apex/manifest.json
new file mode 100644
index 0000000..05d634a
--- /dev/null
+++ b/testing/data/test1/apex/manifest.json
@@ -0,0 +1,4 @@
+{
+  "name": "com.android.tzdata",
+  "version": 2
+}
diff --git a/testing/data/test1/output_data/Android.bp b/testing/data/test1/output_data/Android.bp
new file mode 100644
index 0000000..054a922
--- /dev/null
+++ b/testing/data/test1/output_data/Android.bp
@@ -0,0 +1,48 @@
+// Copyright (C) 2018 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//     http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+prebuilt_etc {
+    name: "apex_tz_version_test1",
+    src: "version/tz_version",
+    filename: "tz_version",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzlookup.xml_test1",
+    src: "android/tzlookup.xml",
+    filename: "tzlookup.xml",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_tzdata_test1",
+    src: "iana/tzdata",
+    notice: "iana/NOTICE",
+    filename: "tzdata",
+    sub_dir: "tz",
+    installable: false,
+}
+
+prebuilt_etc {
+    name: "apex_icu_tzdata.dat_test1",
+    src: "icu_overlay/icu_tzdata.dat",
+    notice: "icu_overlay/LICENSE",
+    filename: "icu_tzdata.dat",
+    sub_dir: "icu",
+    installable: false,
+}
+
diff --git a/testing/data/test1/output_data/android/tzlookup.xml b/testing/data/test1/output_data/android/tzlookup.xml
index a8cdb91..315a6da 100644
--- a/testing/data/test1/output_data/android/tzlookup.xml
+++ b/testing/data/test1/output_data/android/tzlookup.xml
@@ -465,10 +465,11 @@
   </country>
   <country code="kz" default="Asia/Almaty" everutc="n">
    <id>Asia/Almaty</id>
-   <id notafter="1099170000000">Asia/Qyzylorda</id>
+   <id notafter="1099170000000">Asia/Qostanay</id>
    <id notafter="1099173600000">Asia/Aqtau</id>
    <id>Asia/Oral</id>
-   <id>Asia/Aqtobe</id>
+   <id notafter="1545328800000">Asia/Qyzylorda</id>
+   <id notafter="1545328800000">Asia/Aqtobe</id>
    <id notafter="922572000000">Asia/Atyrau</id>
   </country>
   <country code="la" default="Asia/Vientiane" everutc="n">
@@ -524,7 +525,7 @@
   </country>
   <country code="mh" default="Pacific/Majuro" everutc="n">
    <id>Pacific/Majuro</id>
-   <id notafter="745848000000">Pacific/Kwajalein</id>
+   <id notafter="745934400000">Pacific/Kwajalein</id>
   </country>
   <country code="mk" default="Europe/Skopje" everutc="n">
    <id>Europe/Skopje</id>
@@ -868,7 +869,7 @@
    <id notafter="436359600000">America/Juneau</id>
    <id notafter="436356000000">America/Yakutat</id>
    <id notafter="436363200000">America/Nome</id>
-   <id notafter="1446372000000">America/Metlakatla</id>
+   <id notafter="1552215600000">America/Metlakatla</id>
    <id notafter="341402400000">America/Sitka</id>
    <id>Pacific/Honolulu</id>
    <id>America/Adak</id>
diff --git a/testing/data/test1/output_data/distro/distro.zip b/testing/data/test1/output_data/distro/distro.zip
index 3c5c6b7..28d0412 100644
--- a/testing/data/test1/output_data/distro/distro.zip
+++ b/testing/data/test1/output_data/distro/distro.zip
Binary files differ
diff --git a/testing/data/test1/output_data/iana/NOTICE b/testing/data/test1/output_data/iana/NOTICE
new file mode 100644
index 0000000..148eb23
--- /dev/null
+++ b/testing/data/test1/output_data/iana/NOTICE
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.
diff --git a/testing/data/test1/output_data/iana/tzdata b/testing/data/test1/output_data/iana/tzdata
index 8068828..71de696 100644
--- a/testing/data/test1/output_data/iana/tzdata
+++ b/testing/data/test1/output_data/iana/tzdata
Binary files differ
diff --git a/testing/data/test1/output_data/icu_overlay/LICENSE b/testing/data/test1/output_data/icu_overlay/LICENSE
new file mode 100644
index 0000000..25b6eb9
--- /dev/null
+++ b/testing/data/test1/output_data/icu_overlay/LICENSE
@@ -0,0 +1,414 @@
+COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
+
+Copyright © 1991-2018 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
+
+---------------------
+
+Third-Party Software Licenses
+
+This section contains third-party software notices and/or additional
+terms for licensed third-party software components included within ICU
+libraries.
+
+1. ICU License - ICU 1.8.1 to ICU 57.1
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2016 International Business Machines Corporation and others
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the
+property of their respective owners.
+
+2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ #     The Google Chrome software developed by Google is licensed under
+ # the BSD license. Other software included in this distribution is
+ # provided under other licenses, as set forth below.
+ #
+ #  The BSD License
+ #  http://opensource.org/licenses/bsd-license.php
+ #  Copyright (C) 2006-2008, Google Inc.
+ #
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are met:
+ #
+ #  Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #  Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following
+ # disclaimer in the documentation and/or other materials provided with
+ # the distribution.
+ #  Neither the name of  Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
+ #
+ #  The word list in cjdict.txt are generated by combining three word lists
+ # listed below with further processing for compound word breaking. The
+ # frequency is generated with an iterative training against Google web
+ # corpora.
+ #
+ #  * Libtabe (Chinese)
+ #    - https://sourceforge.net/project/?group_id=1519
+ #    - Its license terms and conditions are shown below.
+ #
+ #  * IPADIC (Japanese)
+ #    - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ #    - Its license terms and conditions are shown below.
+ #
+ #  ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ #  /*
+ #   * Copyright (c) 1999 TaBE Project.
+ #   * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ #   * All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the TaBE Project nor the names of its
+ #   *   contributors may be used to endorse or promote products derived
+ #   *   from this software without specific prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  /*
+ #   * Copyright (c) 1999 Computer Systems and Communication Lab,
+ #   *                    Institute of Information Science, Academia
+ #       *                    Sinica. All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the Computer Systems and Communication Lab
+ #   *   nor the names of its contributors may be used to endorse or
+ #   *   promote products derived from this software without specific
+ #   *   prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  Copyright 1996 Chih-Hao Tsai @ Beckman Institute,
+ #      University of Illinois
+ #  c-tsai4@uiuc.edu  http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ #  ---------------COPYING.libtabe-----END--------------------------------
+ #
+ #
+ #  ---------------COPYING.ipadic-----BEGIN-------------------------------
+ #
+ #  Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ #  and Technology.  All Rights Reserved.
+ #
+ #  Use, reproduction, and distribution of this software is permitted.
+ #  Any copy of this software, whether in its original form or modified,
+ #  must include both the above copyright notice and the following
+ #  paragraphs.
+ #
+ #  Nara Institute of Science and Technology (NAIST),
+ #  the copyright holders, disclaims all warranties with regard to this
+ #  software, including all implied warranties of merchantability and
+ #  fitness, in no event shall NAIST be liable for
+ #  any special, indirect or consequential damages or any damages
+ #  whatsoever resulting from loss of use, data or profits, whether in an
+ #  action of contract, negligence or other tortuous action, arising out
+ #  of or in connection with the use or performance of this software.
+ #
+ #  A large portion of the dictionary entries
+ #  originate from ICOT Free Software.  The following conditions for ICOT
+ #  Free Software applies to the current dictionary as well.
+ #
+ #  Each User may also freely distribute the Program, whether in its
+ #  original form or modified, to any third party or parties, PROVIDED
+ #  that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ #  on, or be attached to, the Program, which is distributed substantially
+ #  in the same form as set out herein and that such intended
+ #  distribution, if actually made, will neither violate or otherwise
+ #  contravene any of the laws and regulations of the countries having
+ #  jurisdiction over the User or the intended distribution itself.
+ #
+ #  NO WARRANTY
+ #
+ #  The program was produced on an experimental basis in the course of the
+ #  research and development conducted during the project and is provided
+ #  to users as so produced on an experimental basis.  Accordingly, the
+ #  program is provided without any warranty whatsoever, whether express,
+ #  implied, statutory or otherwise.  The term "warranty" used herein
+ #  includes, but is not limited to, any warranty of the quality,
+ #  performance, merchantability and fitness for a particular purpose of
+ #  the program and the nonexistence of any infringement or violation of
+ #  any right of any third party.
+ #
+ #  Each user of the program will agree and understand, and be deemed to
+ #  have agreed and understood, that there is no warranty whatsoever for
+ #  the program and, accordingly, the entire risk arising from or
+ #  otherwise connected with the program is assumed by the user.
+ #
+ #  Therefore, neither ICOT, the copyright holder, or any other
+ #  organization that participated in or was otherwise related to the
+ #  development of the program and their respective officials, directors,
+ #  officers and other employees shall be held liable for any and all
+ #  damages, including, without limitation, general, special, incidental
+ #  and consequential damages, arising out of or otherwise in connection
+ #  with the use or inability to use the program or any product, material
+ #  or result produced or otherwise obtained by using the program,
+ #  regardless of whether they have been advised of, or otherwise had
+ #  knowledge of, the possibility of such damages at any time during the
+ #  project or thereafter.  Each user will be deemed to have agreed to the
+ #  foregoing by his or her commencement of use of the program.  The term
+ #  "use" as used herein includes, but is not limited to, the use,
+ #  modification, copying and distribution of the program and the
+ #  production of secondary products from the program.
+ #
+ #  In the case where the program, whether in its original form or
+ #  modified, was distributed or delivered to or received by a user from
+ #  any person, organization or entity other than ICOT, unless it makes or
+ #  grants independently of ICOT any specific warranty to the user in
+ #  writing, such person, organization or entity, will also be exempted
+ #  from and not be held liable to the user for any such damages as noted
+ #  above as far as the program is concerned.
+ #
+ #  ---------------COPYING.ipadic-----END----------------------------------
+
+3. Lao Word Break Dictionary Data (laodict.txt)
+
+ #  Copyright (c) 2013 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ # Project: http://code.google.com/p/lao-dictionary/
+ # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
+ #              (copied below)
+ #
+ #  This file is derived from the above dictionary, with slight
+ #  modifications.
+ #  ----------------------------------------------------------------------
+ #  Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification,
+ #  are permitted provided that the following conditions are met:
+ #
+ #
+ # Redistributions of source code must retain the above copyright notice, this
+ #  list of conditions and the following disclaimer. Redistributions in
+ #  binary form must reproduce the above copyright notice, this list of
+ #  conditions and the following disclaimer in the documentation and/or
+ #  other materials provided with the distribution.
+ #
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ #  Copyright (c) 2014 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ #  This list is part of a project hosted at:
+ #    github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ #  --------------------------------------------------------------------------
+ #  Copyright (c) 2013, LeRoy Benjamin Sharon
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification, are permitted provided that the following conditions
+ #  are met: Redistributions of source code must retain the above
+ #  copyright notice, this list of conditions and the following
+ #  disclaimer.  Redistributions in binary form must reproduce the
+ #  above copyright notice, this list of conditions and the following
+ #  disclaimer in the documentation and/or other materials provided
+ #  with the distribution.
+ #
+ #    Neither the name Myanmar Karen Word Lists, nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ #  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ #  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ #  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ #  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ #  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ #  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ #  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ #  SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+5. Time Zone Database
+
+  ICU uses the public domain data and code derived from Time Zone
+Database for its time zone support. The ownership of the TZ database
+is explained in BCP 175: Procedure for Maintaining the Time Zone
+Database section 7.
+
+ # 7.  Database Ownership
+ #
+ #    The TZ database itself is not an IETF Contribution or an IETF
+ #    document.  Rather it is a pre-existing and regularly updated work
+ #    that is in the public domain, and is intended to remain in the
+ #    public domain.  Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do
+ #    not apply to the TZ Database or contributions that individuals make
+ #    to it.  Should any claims be made and substantiated against the TZ
+ #    Database, the organization that is providing the IANA
+ #    Considerations defined in this RFC, under the memorandum of
+ #    understanding with the IETF, currently ICANN, may act in accordance
+ #    with all competent court orders.  No ownership claims will be made
+ #    by ICANN or the IETF Trust on the database or the code.  Any person
+ #    making a contribution to the database or code waives all rights to
+ #    future claims in that contribution or in the TZ Database.
+
+6. Google double-conversion
+
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat b/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat
index 795820c..b20a9e7 100644
--- a/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat
+++ b/testing/data/test1/output_data/icu_overlay/icu_tzdata.dat
Binary files differ
diff --git a/testing/data/test1/output_data/version/tz_version b/testing/data/test1/output_data/version/tz_version
new file mode 100644
index 0000000..17a4843
--- /dev/null
+++ b/testing/data/test1/output_data/version/tz_version
@@ -0,0 +1 @@
+003.001|2030a|001
\ No newline at end of file
diff --git a/testing/data/test2/output_data/android/tzlookup.xml b/testing/data/test2/output_data/android/tzlookup.xml
index 569bde8..8b101e2 100644
--- a/testing/data/test2/output_data/android/tzlookup.xml
+++ b/testing/data/test2/output_data/android/tzlookup.xml
@@ -465,10 +465,11 @@
   </country>
   <country code="kz" default="Asia/Almaty" everutc="n">
    <id>Asia/Almaty</id>
-   <id notafter="1099170000000">Asia/Qyzylorda</id>
+   <id notafter="1099170000000">Asia/Qostanay</id>
    <id notafter="1099173600000">Asia/Aqtau</id>
    <id>Asia/Oral</id>
-   <id>Asia/Aqtobe</id>
+   <id notafter="1545328800000">Asia/Qyzylorda</id>
+   <id notafter="1545328800000">Asia/Aqtobe</id>
    <id notafter="922572000000">Asia/Atyrau</id>
   </country>
   <country code="la" default="Asia/Vientiane" everutc="n">
@@ -524,7 +525,7 @@
   </country>
   <country code="mh" default="Pacific/Majuro" everutc="n">
    <id>Pacific/Majuro</id>
-   <id notafter="745848000000">Pacific/Kwajalein</id>
+   <id notafter="745934400000">Pacific/Kwajalein</id>
   </country>
   <country code="mk" default="Europe/Skopje" everutc="n">
    <id>Europe/Skopje</id>
@@ -868,7 +869,7 @@
    <id notafter="436359600000">America/Juneau</id>
    <id notafter="436356000000">America/Yakutat</id>
    <id notafter="436363200000">America/Nome</id>
-   <id notafter="1446372000000">America/Metlakatla</id>
+   <id notafter="1552215600000">America/Metlakatla</id>
    <id notafter="341402400000">America/Sitka</id>
    <id>Pacific/Honolulu</id>
    <id>America/Adak</id>
diff --git a/testing/data/test2/output_data/distro/distro.zip b/testing/data/test2/output_data/distro/distro.zip
index b312228..2b182e6 100644
--- a/testing/data/test2/output_data/distro/distro.zip
+++ b/testing/data/test2/output_data/distro/distro.zip
Binary files differ
diff --git a/testing/data/test2/output_data/iana/NOTICE b/testing/data/test2/output_data/iana/NOTICE
new file mode 100644
index 0000000..148eb23
--- /dev/null
+++ b/testing/data/test2/output_data/iana/NOTICE
@@ -0,0 +1,4 @@
+With a few exceptions, all files in the tz code and data (including
+this one) are in the public domain.  The exceptions are date.c,
+newstrftime.3, and strftime.c, which contain material derived from BSD
+and which use the BSD 3-clause license.
diff --git a/testing/data/test2/output_data/iana/tzdata b/testing/data/test2/output_data/iana/tzdata
index 975dbe7..234ee76 100644
--- a/testing/data/test2/output_data/iana/tzdata
+++ b/testing/data/test2/output_data/iana/tzdata
Binary files differ
diff --git a/testing/data/test2/output_data/icu_overlay/LICENSE b/testing/data/test2/output_data/icu_overlay/LICENSE
new file mode 100644
index 0000000..25b6eb9
--- /dev/null
+++ b/testing/data/test2/output_data/icu_overlay/LICENSE
@@ -0,0 +1,414 @@
+COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later)
+
+Copyright © 1991-2018 Unicode, Inc. All rights reserved.
+Distributed under the Terms of Use in http://www.unicode.org/copyright.html.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Unicode data files and any associated documentation
+(the "Data Files") or Unicode software and any associated documentation
+(the "Software") to deal in the Data Files or Software
+without restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, and/or sell copies of
+the Data Files or Software, and to permit persons to whom the Data Files
+or Software are furnished to do so, provided that either
+(a) this copyright and permission notice appear with all copies
+of the Data Files or Software, or
+(b) this copyright and permission notice appear in associated
+Documentation.
+
+THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF
+ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
+WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT OF THIRD PARTY RIGHTS.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS
+NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL
+DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THE DATA FILES OR SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale,
+use or other dealings in these Data Files or Software without prior
+written authorization of the copyright holder.
+
+---------------------
+
+Third-Party Software Licenses
+
+This section contains third-party software notices and/or additional
+terms for licensed third-party software components included within ICU
+libraries.
+
+1. ICU License - ICU 1.8.1 to ICU 57.1
+
+COPYRIGHT AND PERMISSION NOTICE
+
+Copyright (c) 1995-2016 International Business Machines Corporation and others
+All rights reserved.
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, and/or sell copies of the Software, and to permit persons
+to whom the Software is furnished to do so, provided that the above
+copyright notice(s) and this permission notice appear in all copies of
+the Software and that both the above copyright notice(s) and this
+permission notice appear in supporting documentation.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
+HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY
+SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER
+RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF
+CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+
+Except as contained in this notice, the name of a copyright holder
+shall not be used in advertising or otherwise to promote the sale, use
+or other dealings in this Software without prior written authorization
+of the copyright holder.
+
+All trademarks and registered trademarks mentioned herein are the
+property of their respective owners.
+
+2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt)
+
+ #     The Google Chrome software developed by Google is licensed under
+ # the BSD license. Other software included in this distribution is
+ # provided under other licenses, as set forth below.
+ #
+ #  The BSD License
+ #  http://opensource.org/licenses/bsd-license.php
+ #  Copyright (C) 2006-2008, Google Inc.
+ #
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ # modification, are permitted provided that the following conditions are met:
+ #
+ #  Redistributions of source code must retain the above copyright notice,
+ # this list of conditions and the following disclaimer.
+ #  Redistributions in binary form must reproduce the above
+ # copyright notice, this list of conditions and the following
+ # disclaimer in the documentation and/or other materials provided with
+ # the distribution.
+ #  Neither the name of  Google Inc. nor the names of its
+ # contributors may be used to endorse or promote products derived from
+ # this software without specific prior written permission.
+ #
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
+ # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ #
+ #
+ #  The word list in cjdict.txt are generated by combining three word lists
+ # listed below with further processing for compound word breaking. The
+ # frequency is generated with an iterative training against Google web
+ # corpora.
+ #
+ #  * Libtabe (Chinese)
+ #    - https://sourceforge.net/project/?group_id=1519
+ #    - Its license terms and conditions are shown below.
+ #
+ #  * IPADIC (Japanese)
+ #    - http://chasen.aist-nara.ac.jp/chasen/distribution.html
+ #    - Its license terms and conditions are shown below.
+ #
+ #  ---------COPYING.libtabe ---- BEGIN--------------------
+ #
+ #  /*
+ #   * Copyright (c) 1999 TaBE Project.
+ #   * Copyright (c) 1999 Pai-Hsiang Hsiao.
+ #   * All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the TaBE Project nor the names of its
+ #   *   contributors may be used to endorse or promote products derived
+ #   *   from this software without specific prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  /*
+ #   * Copyright (c) 1999 Computer Systems and Communication Lab,
+ #   *                    Institute of Information Science, Academia
+ #       *                    Sinica. All rights reserved.
+ #   *
+ #   * Redistribution and use in source and binary forms, with or without
+ #   * modification, are permitted provided that the following conditions
+ #   * are met:
+ #   *
+ #   * . Redistributions of source code must retain the above copyright
+ #   *   notice, this list of conditions and the following disclaimer.
+ #   * . Redistributions in binary form must reproduce the above copyright
+ #   *   notice, this list of conditions and the following disclaimer in
+ #   *   the documentation and/or other materials provided with the
+ #   *   distribution.
+ #   * . Neither the name of the Computer Systems and Communication Lab
+ #   *   nor the names of its contributors may be used to endorse or
+ #   *   promote products derived from this software without specific
+ #   *   prior written permission.
+ #   *
+ #   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ #   * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ #   * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ #   * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ #   * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
+ #   * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ #   * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ #   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ #   * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ #   * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ #   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ #   * OF THE POSSIBILITY OF SUCH DAMAGE.
+ #   */
+ #
+ #  Copyright 1996 Chih-Hao Tsai @ Beckman Institute,
+ #      University of Illinois
+ #  c-tsai4@uiuc.edu  http://casper.beckman.uiuc.edu/~c-tsai4
+ #
+ #  ---------------COPYING.libtabe-----END--------------------------------
+ #
+ #
+ #  ---------------COPYING.ipadic-----BEGIN-------------------------------
+ #
+ #  Copyright 2000, 2001, 2002, 2003 Nara Institute of Science
+ #  and Technology.  All Rights Reserved.
+ #
+ #  Use, reproduction, and distribution of this software is permitted.
+ #  Any copy of this software, whether in its original form or modified,
+ #  must include both the above copyright notice and the following
+ #  paragraphs.
+ #
+ #  Nara Institute of Science and Technology (NAIST),
+ #  the copyright holders, disclaims all warranties with regard to this
+ #  software, including all implied warranties of merchantability and
+ #  fitness, in no event shall NAIST be liable for
+ #  any special, indirect or consequential damages or any damages
+ #  whatsoever resulting from loss of use, data or profits, whether in an
+ #  action of contract, negligence or other tortuous action, arising out
+ #  of or in connection with the use or performance of this software.
+ #
+ #  A large portion of the dictionary entries
+ #  originate from ICOT Free Software.  The following conditions for ICOT
+ #  Free Software applies to the current dictionary as well.
+ #
+ #  Each User may also freely distribute the Program, whether in its
+ #  original form or modified, to any third party or parties, PROVIDED
+ #  that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear
+ #  on, or be attached to, the Program, which is distributed substantially
+ #  in the same form as set out herein and that such intended
+ #  distribution, if actually made, will neither violate or otherwise
+ #  contravene any of the laws and regulations of the countries having
+ #  jurisdiction over the User or the intended distribution itself.
+ #
+ #  NO WARRANTY
+ #
+ #  The program was produced on an experimental basis in the course of the
+ #  research and development conducted during the project and is provided
+ #  to users as so produced on an experimental basis.  Accordingly, the
+ #  program is provided without any warranty whatsoever, whether express,
+ #  implied, statutory or otherwise.  The term "warranty" used herein
+ #  includes, but is not limited to, any warranty of the quality,
+ #  performance, merchantability and fitness for a particular purpose of
+ #  the program and the nonexistence of any infringement or violation of
+ #  any right of any third party.
+ #
+ #  Each user of the program will agree and understand, and be deemed to
+ #  have agreed and understood, that there is no warranty whatsoever for
+ #  the program and, accordingly, the entire risk arising from or
+ #  otherwise connected with the program is assumed by the user.
+ #
+ #  Therefore, neither ICOT, the copyright holder, or any other
+ #  organization that participated in or was otherwise related to the
+ #  development of the program and their respective officials, directors,
+ #  officers and other employees shall be held liable for any and all
+ #  damages, including, without limitation, general, special, incidental
+ #  and consequential damages, arising out of or otherwise in connection
+ #  with the use or inability to use the program or any product, material
+ #  or result produced or otherwise obtained by using the program,
+ #  regardless of whether they have been advised of, or otherwise had
+ #  knowledge of, the possibility of such damages at any time during the
+ #  project or thereafter.  Each user will be deemed to have agreed to the
+ #  foregoing by his or her commencement of use of the program.  The term
+ #  "use" as used herein includes, but is not limited to, the use,
+ #  modification, copying and distribution of the program and the
+ #  production of secondary products from the program.
+ #
+ #  In the case where the program, whether in its original form or
+ #  modified, was distributed or delivered to or received by a user from
+ #  any person, organization or entity other than ICOT, unless it makes or
+ #  grants independently of ICOT any specific warranty to the user in
+ #  writing, such person, organization or entity, will also be exempted
+ #  from and not be held liable to the user for any such damages as noted
+ #  above as far as the program is concerned.
+ #
+ #  ---------------COPYING.ipadic-----END----------------------------------
+
+3. Lao Word Break Dictionary Data (laodict.txt)
+
+ #  Copyright (c) 2013 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ # Project: http://code.google.com/p/lao-dictionary/
+ # Dictionary: http://lao-dictionary.googlecode.com/git/Lao-Dictionary.txt
+ # License: http://lao-dictionary.googlecode.com/git/Lao-Dictionary-LICENSE.txt
+ #              (copied below)
+ #
+ #  This file is derived from the above dictionary, with slight
+ #  modifications.
+ #  ----------------------------------------------------------------------
+ #  Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell.
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification,
+ #  are permitted provided that the following conditions are met:
+ #
+ #
+ # Redistributions of source code must retain the above copyright notice, this
+ #  list of conditions and the following disclaimer. Redistributions in
+ #  binary form must reproduce the above copyright notice, this list of
+ #  conditions and the following disclaimer in the documentation and/or
+ #  other materials provided with the distribution.
+ #
+ #
+ # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
+ # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+ # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+ # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+ # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+ # OF THE POSSIBILITY OF SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+4. Burmese Word Break Dictionary Data (burmesedict.txt)
+
+ #  Copyright (c) 2014 International Business Machines Corporation
+ #  and others. All Rights Reserved.
+ #
+ #  This list is part of a project hosted at:
+ #    github.com/kanyawtech/myanmar-karen-word-lists
+ #
+ #  --------------------------------------------------------------------------
+ #  Copyright (c) 2013, LeRoy Benjamin Sharon
+ #  All rights reserved.
+ #
+ #  Redistribution and use in source and binary forms, with or without
+ #  modification, are permitted provided that the following conditions
+ #  are met: Redistributions of source code must retain the above
+ #  copyright notice, this list of conditions and the following
+ #  disclaimer.  Redistributions in binary form must reproduce the
+ #  above copyright notice, this list of conditions and the following
+ #  disclaimer in the documentation and/or other materials provided
+ #  with the distribution.
+ #
+ #    Neither the name Myanmar Karen Word Lists, nor the names of its
+ #    contributors may be used to endorse or promote products derived
+ #    from this software without specific prior written permission.
+ #
+ #  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
+ #  CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
+ #  INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ #  MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+ #  DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
+ #  BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ #  EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
+ #  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ #  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ #  ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
+ #  TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
+ #  THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ #  SUCH DAMAGE.
+ #  --------------------------------------------------------------------------
+
+5. Time Zone Database
+
+  ICU uses the public domain data and code derived from Time Zone
+Database for its time zone support. The ownership of the TZ database
+is explained in BCP 175: Procedure for Maintaining the Time Zone
+Database section 7.
+
+ # 7.  Database Ownership
+ #
+ #    The TZ database itself is not an IETF Contribution or an IETF
+ #    document.  Rather it is a pre-existing and regularly updated work
+ #    that is in the public domain, and is intended to remain in the
+ #    public domain.  Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do
+ #    not apply to the TZ Database or contributions that individuals make
+ #    to it.  Should any claims be made and substantiated against the TZ
+ #    Database, the organization that is providing the IANA
+ #    Considerations defined in this RFC, under the memorandum of
+ #    understanding with the IETF, currently ICANN, may act in accordance
+ #    with all competent court orders.  No ownership claims will be made
+ #    by ICANN or the IETF Trust on the database or the code.  Any person
+ #    making a contribution to the database or code waives all rights to
+ #    future claims in that contribution or in the TZ Database.
+
+6. Google double-conversion
+
+Copyright 2006-2011, the V8 project authors. All rights reserved.
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions are
+met:
+
+    * Redistributions of source code must retain the above copyright
+      notice, this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above
+      copyright notice, this list of conditions and the following
+      disclaimer in the documentation and/or other materials provided
+      with the distribution.
+    * Neither the name of Google Inc. nor the names of its
+      contributors may be used to endorse or promote products derived
+      from this software without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat b/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat
index 7fb0cef..8569310 100644
--- a/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat
+++ b/testing/data/test2/output_data/icu_overlay/icu_tzdata.dat
Binary files differ
diff --git a/testing/data/test2/output_data/version/tz_version b/testing/data/test2/output_data/version/tz_version
new file mode 100644
index 0000000..85af1a2
--- /dev/null
+++ b/testing/data/test2/output_data/version/tz_version
@@ -0,0 +1 @@
+003.001|2016a|001
\ No newline at end of file
diff --git a/testing/data/transform-distro-files.sh b/testing/data/transform-distro-files.sh
index 8bce035..d51e554 100755
--- a/testing/data/transform-distro-files.sh
+++ b/testing/data/transform-distro-files.sh
@@ -14,18 +14,20 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
-# Creates fake distro data files by taking the files in $1 and turning them into ones
+# Creates fake test data files by taking the files in $1 and turning them into ones
 # that appear to be ones from IANA release $2. The resulting files are placed beneath $3.
 
 REFERENCE_FILES_DIR=$1
 OUTPUT_IANA_RULES_VERSION=$2
-DISTRO_OUTPUT_DIR=$3
+TEST_DATA_OUTPUT_DIR=$3
 
 # Fail on error
 set -e
 
 TZDATA_FILE=iana/tzdata
+TZDATA_LICENSE_FILE=iana/NOTICE
 ICU_FILE=icu_overlay/icu_tzdata.dat
+ICU_LICENSE_FILE=icu_overlay/LICENSE
 TZLOOKUP_FILE=android/tzlookup.xml
 
 INPUT_TZDATA_FILE=${REFERENCE_FILES_DIR}/${TZDATA_FILE}
@@ -35,14 +37,14 @@
 TZHEADER=$(head -n1 ${INPUT_TZDATA_FILE} | cut -c1-11)
 INPUT_IANA_RULES_VERSION=${TZHEADER:6}
 
-OUTPUT_TZDATA_FILE=${DISTRO_OUTPUT_DIR}/${TZDATA_FILE}
-OUTPUT_ICU_FILE=${DISTRO_OUTPUT_DIR}/${ICU_FILE}
-OUTPUT_TZLOOKUP_FILE=${DISTRO_OUTPUT_DIR}/${TZLOOKUP_FILE}
+OUTPUT_TZDATA_FILE=${TEST_DATA_OUTPUT_DIR}/${TZDATA_FILE}
+OUTPUT_ICU_FILE=${TEST_DATA_OUTPUT_DIR}/${ICU_FILE}
+OUTPUT_TZLOOKUP_FILE=${TEST_DATA_OUTPUT_DIR}/${TZLOOKUP_FILE}
 
-mkdir -p ${DISTRO_OUTPUT_DIR}
-mkdir -p ${DISTRO_OUTPUT_DIR}/iana
-mkdir -p ${DISTRO_OUTPUT_DIR}/icu_overlay
-mkdir -p ${DISTRO_OUTPUT_DIR}/android
+mkdir -p ${TEST_DATA_OUTPUT_DIR}
+mkdir -p ${TEST_DATA_OUTPUT_DIR}/iana
+mkdir -p ${TEST_DATA_OUTPUT_DIR}/icu_overlay
+mkdir -p ${TEST_DATA_OUTPUT_DIR}/android
 
 # Create a new tzdata file.
 sed "1s/^tzdata${INPUT_IANA_RULES_VERSION}/tzdata${OUTPUT_IANA_RULES_VERSION}/" ${INPUT_TZDATA_FILE} > ${OUTPUT_TZDATA_FILE}
@@ -55,5 +57,9 @@
 # Copy the tzlookup.xml but update the ianaversion= attribute.
 sed "s/${INPUT_IANA_RULES_VERSION}/${OUTPUT_IANA_RULES_VERSION}/" ${INPUT_TZLOOKUP_FILE} > ${OUTPUT_TZLOOKUP_FILE}
 
-echo Transformed input files with version ${INPUT_IANA_RULES_VERSION} to ${OUTPUT_IANA_RULES_VERSION} in ${DISTRO_OUTPUT_DIR}
+# Copy license files
+cp ${REFERENCE_FILES_DIR}/${TZDATA_LICENSE_FILE} ${TEST_DATA_OUTPUT_DIR}/${TZDATA_LICENSE_FILE}
+cp ${REFERENCE_FILES_DIR}/${ICU_LICENSE_FILE} ${TEST_DATA_OUTPUT_DIR}/${ICU_LICENSE_FILE}
+
+echo Transformed input files with version ${INPUT_IANA_RULES_VERSION} to ${OUTPUT_IANA_RULES_VERSION} in ${TEST_DATA_OUTPUT_DIR}
 
diff --git a/testing/src/main/java/libcore/tzdata/testing/ZoneInfoTestHelper.java b/testing/src/main/java/libcore/timezone/testing/ZoneInfoTestHelper.java
similarity index 99%
rename from testing/src/main/java/libcore/tzdata/testing/ZoneInfoTestHelper.java
rename to testing/src/main/java/libcore/timezone/testing/ZoneInfoTestHelper.java
index 75ddc66..bdfd707 100644
--- a/testing/src/main/java/libcore/tzdata/testing/ZoneInfoTestHelper.java
+++ b/testing/src/main/java/libcore/timezone/testing/ZoneInfoTestHelper.java
@@ -13,7 +13,7 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package libcore.tzdata.testing;
+package libcore.timezone.testing;
 
 import java.io.ByteArrayOutputStream;
 import java.nio.ByteBuffer;
diff --git a/tzdatacheck/tzdatacheck.cpp b/tzdatacheck/tzdatacheck.cpp
index c41d057..2285219 100644
--- a/tzdatacheck/tzdatacheck.cpp
+++ b/tzdatacheck/tzdatacheck.cpp
@@ -47,53 +47,48 @@
 // See also com.android.timezone.distro.TimeZoneDistro / com.android.timezone.distro.DistroVersion.
 static const char* DISTRO_VERSION_FILENAME = "/distro_version";
 
-// distro_version is an ASCII file consisting of 17 bytes in the form: AAA.BBB|CCCCC|DDD
-// AAA.BBB is the major/minor version of the distro format (e.g. 001.001),
-// CCCCC is the rules version (e.g. 2016g)
-// DDD is the android revision for this rules version to allow for distro corrections (e.g. 001)
-// We only need the first 13 to determine if it is suitable for the device.
-static const int DISTRO_VERSION_LENGTH = 13;
+// The name of the file containing the base tz data set version information.
+// See also libcore.timezone.TzDataSetVersion.
+static const char* BASE_VERSION_FILENAME = "/tz_version";
 
-// The major version of the distro format supported by this code as a null-terminated char[].
-// See also com.android.timezone.distro.TimeZoneDistro / com.android.timezone.distro.DistroVersion.
-static const char SUPPORTED_DISTRO_MAJOR_VERSION[] = "002";
+// distro_version / tz_version are ASCII files consisting of at least 17 bytes in the
+// form: AAA.BBB|CCCCC|DDD
+// AAA.BBB is the major/minor version of the format (e.g. 004.001),
+// CCCCC is the rules version (e.g. 2016g),
+// DDD is the android revision for this rules version to allow for data corrections (e.g. 001),
+// We only use the first 13 to determine suitability of format / data.
+static const int READ_DATA_LENGTH = 13;
 
-// The length of the distro format major version excluding the \0
-static const size_t SUPPORTED_DISTRO_MAJOR_VERSION_LEN = sizeof(SUPPORTED_DISTRO_MAJOR_VERSION) - 1;
+// Version bytes are: AAA.BBB|CCCCC - the format version is AAA.BBB
+// The length of the format version,  e.g. "004.001" == 7 bytes
+static const size_t FORMAT_VERSION_LEN = 7;
 
-// The minor version of the distro format supported by this code as a null-terminated char[].
-// See also com.android.timezone.distro.TimeZoneDistro / com.android.timezone.distro.DistroVersion.
-static const char SUPPORTED_DISTRO_MINOR_VERSION[] = "001";
+// Version bytes are: AAA.BBB|CCCCC - the format major version is AAA
+static const size_t FORMAT_MAJOR_VERSION_LEN = 3;
 
-// The length of the distro format minor version excluding the \0
-static const size_t SUPPORTED_DISTRO_MINOR_VERSION_LEN = sizeof(SUPPORTED_DISTRO_MINOR_VERSION) - 1;
+// Version bytes are: AAA.BBB|CCCCC - the format major version is AAA
+static const size_t FORMAT_MAJOR_VERSION_IDX = 0;
 
-// The length of the distro format version. e.g. 001.001
-static const size_t SUPPORTED_DISTRO_VERSION_LEN =
-        SUPPORTED_DISTRO_MAJOR_VERSION_LEN + SUPPORTED_DISTRO_MINOR_VERSION_LEN + 1;
+// Version bytes are: AAA.BBB|CCCCC - the format major version is AAA
+static const size_t FORMAT_MINOR_VERSION_LEN = 3;
 
-// The length of the IANA rules version bytes. e.g. 2016a
+// Version bytes are: AAA.BBB|CCCCC - the format minor version is BBB
+static const size_t FORMAT_MINOR_VERSION_IDX = 4;
+
+// Version bytes are: AAA.BBB|CCCCC - the IANA rules version is CCCCC
+// The length of the IANA rules version bytes, e.g. 2016a
 static const size_t RULES_VERSION_LEN = 5;
 
-// Distro version bytes are: AAA.BBB|CCCCC - the rules version is CCCCC
-static const size_t DISTRO_VERSION_RULES_IDX = 8;
+// Version bytes are: AAA.BBB|CCCCC - the rules version is CCCCC
+static const size_t VERSION_RULES_IDX = 8;
 
-// See also com.android.timezone.distro.TimeZoneDistro.
-static const char* TZDATA_FILENAME = "/tzdata";
-
-// tzdata file header (as much as we need for the version):
-// byte[11] tzdata_version  -- e.g. "tzdata2012f"
-static const int TZ_HEADER_LENGTH = 11;
-
-static const char TZ_DATA_HEADER_PREFIX[] = "tzdata";
-static const size_t TZ_DATA_HEADER_PREFIX_LEN = sizeof(TZ_DATA_HEADER_PREFIX) - 1; // exclude \0
 
 static void usage() {
-    std::cerr << "Usage: tzdatacheck SYSTEM_TZ_DIR DATA_TZ_DIR\n"
+    std::cerr << "Usage: tzdatacheck BASE_TZ_DIR DATA_TZ_DIR\n"
             "\n"
             "Checks whether any timezone update distro in DATA_TZ_DIR is compatible with the\n"
-            "current Android release and better than or the same as base system timezone rules in\n"
-            "SYSTEM_TZ_DIR. If the timezone rules in SYSTEM_TZ_DIR are a higher version than the\n"
+            "current Android release and better than or the same as base timezone rules in\n"
+            "BASE_TZ_DIR. If the timezone rules in BASE_TZ_DIR are a higher version than the\n"
             "one in DATA_TZ_DIR the DATA_TZ_DIR is renamed and then deleted.\n";
     exit(1);
 }
@@ -120,18 +115,6 @@
     return true;
 }
 
-/*
- * Checks the contents of headerBytes. Returns true if it is valid (starts with "tzdata"), false
- * otherwise.
- */
-static bool checkValidTzDataHeader(const std::string& fileName, const char* headerBytes) {
-    if (strncmp("tzdata", headerBytes, 6) != 0) {
-        LOG(WARNING) << fileName << " does not start with the expected bytes (tzdata)";
-        return false;
-    }
-    return true;
-}
-
 static bool checkDigits(const char* buffer, const size_t count, size_t* i) {
     for (size_t j = 0; j < count; j++) {
       char toCheck = buffer[(*i)++];
@@ -142,8 +125,8 @@
     return true;
 }
 
-static bool checkValidDistroVersion(const char* buffer) {
-    // See DISTRO_VERSION_LENGTH comments above for a description of the format.
+static bool checkValidVersionBytes(const char* buffer) {
+    // See READ_DATA_LENGTH comments above for a description of the format.
     size_t i = 0;
     if (!checkDigits(buffer, 3, &i)) {
       return false;
@@ -288,21 +271,6 @@
 }
 
 /*
- * Deletes the ConfigInstaller metadata directory.
- * TODO(nfuller). http://b/31008728 Remove this when ConfigInstaller is no longer used.
- */
-static void deleteConfigUpdaterMetadataDir(const char* dataZoneInfoDir) {
-    // Delete the update metadata
-    std::string dataUpdatesDirName(dataZoneInfoDir);
-    dataUpdatesDirName += "/updates";
-    LOG(INFO) << "Removing: " << dataUpdatesDirName;
-    if (!deleteDir(dataUpdatesDirName)) {
-        LOG(WARNING) << "Deletion of install metadata " << dataUpdatesDirName
-                << " was not successful";
-    }
-}
-
-/*
  * Deletes the timezone update distro directory.
  */
 static void deleteUpdateDistroDir(const std::string& distroDirName) {
@@ -451,7 +419,7 @@
 }
 
 /*
- * After a platform update it is likely that timezone data found on the system partition will be
+ * After a platform update it is likely that the "base" timezone data found on the device will be
  * newer than the version found in the data partition. This tool detects this case and removes the
  * version in /data.
  *
@@ -459,7 +427,7 @@
  * paths for the metadata and current timezone data must match.
  *
  * Typically on device the two args will be:
- *   /system/usr/share/zoneinfo /data/misc/zoneinfo
+ *   /apex/com.google.runtime/etc/tz /data/misc/zoneinfo
  *
  * See usage() for usage notes.
  */
@@ -469,7 +437,7 @@
         return 1;
     }
 
-    const char* systemZoneInfoDir = argv[1];
+    const char* baseZoneInfoDir = argv[1];
     const char* dataZoneInfoDir = argv[2];
 
     std::string dataStagedDirName(dataZoneInfoDir);
@@ -504,86 +472,84 @@
     std::string distroVersionFileName(dataCurrentDirName);
     distroVersionFileName += DISTRO_VERSION_FILENAME;
     std::vector<char> distroVersion;
-    distroVersion.reserve(DISTRO_VERSION_LENGTH);
+    distroVersion.reserve(READ_DATA_LENGTH);
     bool distroVersionReadOk =
-            readBytes(distroVersionFileName, distroVersion.data(), DISTRO_VERSION_LENGTH);
+            readBytes(distroVersionFileName, distroVersion.data(), READ_DATA_LENGTH);
     if (!distroVersionReadOk) {
         LOG(WARNING) << "distro version file " << distroVersionFileName
                 << " does not exist or is too short. Deleting distro dir.";
         // Implies the contents of the data partition is corrupt in some way. Try to clean up.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 3;
     }
 
-    if (!checkValidDistroVersion(distroVersion.data())) {
+    if (!checkValidVersionBytes(distroVersion.data())) {
         LOG(WARNING) << "distro version file " << distroVersionFileName
                 << " is not valid. Deleting distro dir.";
         // Implies the contents of the data partition is corrupt in some way. Try to clean up.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 4;
     }
 
-    std::string actualDistroVersion =
-            std::string(distroVersion.data(), SUPPORTED_DISTRO_VERSION_LEN);
-    // Check the first 3 bytes of the distro version: these are the major version (e.g. 001).
+    // Check the base tz data set version.
+    std::string baseVersionFileName(baseZoneInfoDir);
+    baseVersionFileName += BASE_VERSION_FILENAME;
+    std::vector<char> baseVersion;
+    baseVersion.reserve(READ_DATA_LENGTH);
+    bool baseVersionReadOk =
+            readBytes(baseVersionFileName, baseVersion.data(), READ_DATA_LENGTH);
+    if (!baseVersionReadOk) {
+        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
+        LOG(WARNING) << baseVersionFileName << " does not exist or could not be opened";
+        return 6;
+    }
+
+    if (!checkValidVersionBytes(baseVersion.data())) {
+        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
+        LOG(WARNING) << baseVersionFileName << " is not valid.";
+        return 7;
+    }
+
+    std::string actualDistroVersion = std::string(distroVersion.data(), FORMAT_VERSION_LEN);
+    std::string baseTzVersion = std::string(baseVersion.data(), FORMAT_VERSION_LEN);
+
+    // Check the first 3 bytes of the format version: these are the major version (e.g. 001).
     // It must match the one we support exactly to be ok.
     if (strncmp(
-            &distroVersion[0],
-            SUPPORTED_DISTRO_MAJOR_VERSION,
-            SUPPORTED_DISTRO_MAJOR_VERSION_LEN) != 0) {
+            &distroVersion[FORMAT_MAJOR_VERSION_IDX],
+            &baseTzVersion[FORMAT_MAJOR_VERSION_IDX],
+            FORMAT_MAJOR_VERSION_LEN) != 0) {
 
         LOG(INFO) << "distro version file " << distroVersionFileName
-                << " major version is not the required version " << SUPPORTED_DISTRO_MAJOR_VERSION
+                << " major version is not the required version " << baseTzVersion
                 << ", was \"" << actualDistroVersion << "\". Deleting distro dir.";
-        // This implies there has been an OTA and the installed distro is not compatible with the
+        // This implies there has been an OTA and the installed distro is not compatible with a
         // new version of Android. Remove the installed distro.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 5;
     }
 
-    // Check the last 3 bytes of the distro version: these are the minor version (e.g. 001).
+    // Check the last 3 bytes of the format version: these are the minor version (e.g. 001).
     // If the version in the distro is < the minor version required by this device it cannot be
     // used.
     if (strncmp(
-            &distroVersion[4],
-            SUPPORTED_DISTRO_MINOR_VERSION,
-            SUPPORTED_DISTRO_MINOR_VERSION_LEN) < 0) {
+            &distroVersion[FORMAT_MINOR_VERSION_IDX],
+            &baseTzVersion[FORMAT_MINOR_VERSION_IDX],
+            FORMAT_MINOR_VERSION_LEN) < 0) {
 
         LOG(INFO) << "distro version file " << distroVersionFileName
-                << " minor version is not the required version " << SUPPORTED_DISTRO_MINOR_VERSION
+                << " minor version is not the required version " << baseTzVersion
                 << ", was \"" << actualDistroVersion << "\". Deleting distro dir.";
-        // This implies there has been an OTA and the installed distro is not compatible with the
+        // This implies there has been an OTA and the installed distro is not compatible with a
         // new version of Android. Remove the installed distro.
-        deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
         deleteUpdateDistroDir(dataCurrentDirName);
         return 5;
     }
 
-    // Read the system rules version out of the /system tzdata file.
-    std::string systemTzDataFileName(systemZoneInfoDir);
-    systemTzDataFileName += TZDATA_FILENAME;
-    std::vector<char> systemTzDataHeader;
-    systemTzDataHeader.reserve(TZ_HEADER_LENGTH);
-    bool systemFileExists =
-            readBytes(systemTzDataFileName, systemTzDataHeader.data(), TZ_HEADER_LENGTH);
-    if (!systemFileExists) {
-        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
-        LOG(WARNING) << systemTzDataFileName << " does not exist or could not be opened";
-        return 6;
-    }
-    if (!checkValidTzDataHeader(systemTzDataFileName, systemTzDataHeader.data())) {
-        // Implies the contents of the system partition is corrupt in some way. Nothing we can do.
-        LOG(WARNING) << systemTzDataFileName << " does not have a valid header.";
-        return 7;
-    }
-
     // Compare the distro rules version against the system rules version.
     if (strncmp(
-            &systemTzDataHeader[TZ_DATA_HEADER_PREFIX_LEN],
-            &distroVersion[DISTRO_VERSION_RULES_IDX],
+            &baseVersion[VERSION_RULES_IDX],
+            &distroVersion[VERSION_RULES_IDX],
             RULES_VERSION_LEN) <= 0) {
         LOG(INFO) << "Found an installed distro but it is valid. No action taken.";
         // Implies there is an installed update, but it is good.
@@ -593,9 +559,8 @@
     // Implies there has been an OTA and the system version of the timezone rules is now newer
     // than the version installed in /data. Remove the installed distro.
     LOG(INFO) << "timezone distro in " << dataCurrentDirName << " is older than data in "
-            << systemTzDataFileName << "; fixing...";
+            << baseVersionFileName << "; fixing...";
 
-    deleteConfigUpdaterMetadataDir(dataZoneInfoDir);
     deleteUpdateDistroDir(dataCurrentDirName);
     return 0;
 }
diff --git a/tzdatautil.py b/tzdatautil.py
index 839a9f4..b7f81e3 100644
--- a/tzdatautil.py
+++ b/tzdatautil.py
@@ -12,6 +12,8 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 
+from __future__ import print_function
+
 import os
 import sys
 
@@ -28,6 +30,6 @@
   elif len(matching_files) == 1:
     return '%s/%s' % (dir_name, matching_files[0])
   else:
-    print 'Multiple tz%s files found unexpectedly %s' % (file_type, matching_files)
+    print('Multiple tz%s files found unexpectedly %s' % (file_type, matching_files))
     sys.exit(1)
 
diff --git a/tzlookup_generator/Android.bp b/tzlookup_generator/Android.bp
new file mode 100644
index 0000000..a05979f
--- /dev/null
+++ b/tzlookup_generator/Android.bp
@@ -0,0 +1,40 @@
+// Copyright (C) 2017 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+// Proto library
+java_library_host {
+    name: "countryzonesprotos",
+    proto: {
+        type: "full",
+        include_dirs: ["external/protobuf/src"],
+    },
+
+    srcs: ["src/main/proto/**/*.proto"],
+}
+
+// The tzlookup_generator host tool.
+java_binary_host {
+    name: "tzlookup_generator",
+
+    manifest: "src/main/manifest/MANIFEST.mf",
+    srcs: ["src/main/java/**/*.java"],
+    javacflags: [
+        "-encoding UTF-8",
+    ],
+    static_libs: [
+        "icu4j",
+        "countryzonesprotos",
+        "libprotobuf-java-full",
+    ],
+}
diff --git a/tzlookup_generator/Android.mk b/tzlookup_generator/Android.mk
deleted file mode 100644
index e70efb2..0000000
--- a/tzlookup_generator/Android.mk
+++ /dev/null
@@ -1,38 +0,0 @@
-# Copyright (C) 2017 The Android Open Source Project
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-LOCAL_PATH:= $(call my-dir)
-
-# Proto library
-include $(CLEAR_VARS)
-LOCAL_MODULE := countryzonesprotos
-LOCAL_PROTOC_OPTIMIZE_TYPE := full
-LOCAL_PROTOC_FLAGS := -Iexternal/protobuf/src
-LOCAL_SOURCE_FILES_ALL_GENERATED := true
-LOCAL_SRC_FILES := $(call all-proto-files-under, src/main/proto)
-include $(BUILD_HOST_JAVA_LIBRARY)
-
-# A static library for the tzlookup_generator host tool.
-# The tool can be run with java -jar tzlookup_generator.jar
-include $(CLEAR_VARS)
-LOCAL_MODULE := tzlookup_generator
-LOCAL_MODULE_TAGS := optional
-LOCAL_JAR_MANIFEST := src/main/manifest/MANIFEST.mf
-LOCAL_SRC_FILES := $(call all-java-files-under, src/main/java)
-LOCAL_JAVACFLAGS := -encoding UTF-8
-LOCAL_STATIC_JAVA_LIBRARIES := \
-    icu4j-host \
-    countryzonesprotos \
-    libprotobuf-java-full
-include $(BUILD_HOST_JAVA_LIBRARY)
diff --git a/update-tzdata.py b/update-tzdata.py
index 20986c7..0d7aad9 100755
--- a/update-tzdata.py
+++ b/update-tzdata.py
@@ -16,6 +16,8 @@
 
 """Generates the timezone data files used by Android."""
 
+from __future__ import print_function
+
 import glob
 import os
 import re
@@ -58,7 +60,7 @@
 
   zic_input_file = '%s/%s' % (extracted_iana_data_dir, zic_input_file_name)
   if not os.path.exists(zic_input_file):
-    print 'Could not find %s' % zic_input_file
+    print('Could not find %s' % zic_input_file)
     sys.exit(1)
   return zic_input_file
 
@@ -96,10 +98,15 @@
   # Create ICU system image files.
   icuutil.MakeAndCopyIcuDataFiles(icu_build_dir)
 
+  icu_overlay_dir = '%s/icu_overlay' % timezone_output_data_dir
+
   # Create the ICU overlay time zone file.
-  icu_overlay_dat_file = '%s/icu_overlay/icu_tzdata.dat' % timezone_output_data_dir
+  icu_overlay_dat_file = '%s/icu_tzdata.dat' % icu_overlay_dir
   icuutil.MakeAndCopyOverlayTzIcuData(icu_build_dir, icu_overlay_dat_file)
 
+  # Copy ICU license file(s)
+  icuutil.CopyLicenseFiles(icu_overlay_dir)
+
 
 def GetIanaVersion(iana_tar_file):
   iana_tar_filename = os.path.basename(iana_tar_file)
@@ -108,7 +115,7 @@
 
 
 def ExtractTarFile(tar_file, dir):
-  print 'Extracting %s...' % tar_file
+  print('Extracting %s...' % tar_file)
   if not os.path.exists(dir):
     os.mkdir(dir)
   tar = tarfile.open(tar_file, 'r')
@@ -121,31 +128,31 @@
   iana_zic_data_tar_file = tzdatautil.GetIanaTarFile(iana_tools_dir, 'data')
   iana_zic_data_version = GetIanaVersion(iana_zic_data_tar_file)
 
-  print 'Found IANA zic release %s/%s in %s/%s ...' \
-      % (iana_zic_code_version, iana_zic_data_version, iana_zic_code_tar_file, iana_zic_data_tar_file)
+  print('Found IANA zic release %s/%s in %s/%s ...' \
+      % (iana_zic_code_version, iana_zic_data_version, iana_zic_code_tar_file, iana_zic_data_tar_file))
 
   zic_build_dir = '%s/zic' % tmp_dir
   ExtractTarFile(iana_zic_code_tar_file, zic_build_dir)
   ExtractTarFile(iana_zic_data_tar_file, zic_build_dir)
 
   # zic
-  print 'Building zic...'
+  print('Building zic...')
   # VERSION_DEPS= is to stop the build process looking for files that might not
   # be present across different versions.
   subprocess.check_call(['make', '-C', zic_build_dir, 'zic'])
 
   zic_binary_file = '%s/zic' % zic_build_dir
   if not os.path.exists(zic_binary_file):
-    print 'Could not find %s' % zic_binary_file
+    print('Could not find %s' % zic_binary_file)
     sys.exit(1)
   return zic_binary_file
 
 
 def BuildTzdata(zic_binary_file, extracted_iana_data_dir, iana_data_version):
-  print 'Generating zic input file...'
+  print('Generating zic input file...')
   zic_input_file = GenerateZicInputFile(extracted_iana_data_dir)
 
-  print 'Calling zic...'
+  print('Calling zic...')
   zic_output_dir = '%s/data' % tmp_dir
   os.mkdir(zic_output_dir)
   zic_cmd = [zic_binary_file, '-d', zic_output_dir, zic_input_file]
@@ -154,7 +161,7 @@
   # ZoneCompactor
   zone_compactor_setup_file = WriteSetupFile(zic_input_file)
 
-  print 'Calling ZoneCompactor to update tzdata to %s...' % iana_data_version
+  print('Calling ZoneCompactor to update tzdata to %s...' % iana_data_version)
   subprocess.check_call(['make', '-C', android_build_top, '-j30', 'zone_compactor'])
 
   # Create args for ZoneCompactor
@@ -162,7 +169,7 @@
   jar_file = '%s/framework/zone_compactor.jar' % android_host_out
   header_string = 'tzdata%s' % iana_data_version
 
-  print 'Executing ZoneCompactor...'
+  print('Executing ZoneCompactor...')
   iana_output_data_dir = '%s/iana' % timezone_output_data_dir
   subprocess.check_call(['java', '-jar', jar_file,
                          zone_compactor_setup_file, zic_output_dir, zone_tab_file,
@@ -173,7 +180,7 @@
   countryzones_source_file = '%s/android/countryzones.txt' % timezone_input_data_dir
   tzlookup_dest_file = '%s/android/tzlookup.xml' % timezone_output_data_dir
 
-  print 'Calling TzLookupGenerator to create tzlookup.xml...'
+  print('Calling TzLookupGenerator to create tzlookup.xml...')
   subprocess.check_call(['make', '-C', android_build_top, '-j30', 'tzlookup_generator'])
 
   jar_file = '%s/framework/tzlookup_generator.jar' % android_host_out
@@ -182,21 +189,17 @@
                          countryzones_source_file, zone_tab_file, tzlookup_dest_file])
 
 
-def CreateDistroFiles(iana_data_version, output_dir):
+def CreateDistroFiles(iana_data_version, output_distro_dir, output_version_file):
   create_distro_script = '%s/distro/tools/create-distro.py' % timezone_dir
 
   tzdata_file = '%s/iana/tzdata' % timezone_output_data_dir
   icu_file = '%s/icu_overlay/icu_tzdata.dat' % timezone_output_data_dir
   tzlookup_file = '%s/android/tzlookup.xml' % timezone_output_data_dir
 
-  distro_file_pattern = '%s/*.zip' % output_dir
-  existing_distro_files = glob.glob(distro_file_pattern)
+  distro_file_pattern = '%s/*.zip' % output_distro_dir
+  existing_files = glob.glob(distro_file_pattern)
 
-  distro_file_metadata_pattern = '%s/*.txt' % output_dir
-  existing_distro_metadata_files = glob.glob(distro_file_metadata_pattern)
-  existing_files = existing_distro_files + existing_distro_metadata_files
-
-  print 'Removing %s' % existing_files
+  print('Removing %s' % existing_files)
   for existing_file in existing_files:
     os.remove(existing_file)
 
@@ -205,7 +208,8 @@
       '-tzdata', tzdata_file,
       '-icu', icu_file,
       '-tzlookup', tzlookup_file,
-      '-output', output_dir])
+      '-output_distro_dir', output_distro_dir,
+      '-output_version_file', output_version_file])
 
 def UpdateTestFiles():
   testing_data_dir = '%s/testing/data' % timezone_dir
@@ -216,17 +220,17 @@
 # Run with no arguments from any directory, with no special setup required.
 # See http://www.iana.org/time-zones/ for more about the source of this data.
 def main():
-  print 'Source data file structure: %s' % timezone_input_data_dir
-  print 'Source tools file structure: %s' % timezone_input_tools_dir
-  print 'Output data file structure: %s' % timezone_output_data_dir
+  print('Source data file structure: %s' % timezone_input_data_dir)
+  print('Source tools file structure: %s' % timezone_input_tools_dir)
+  print('Output data file structure: %s' % timezone_output_data_dir)
 
   iana_input_data_dir = '%s/iana' % timezone_input_data_dir
   iana_data_tar_file = tzdatautil.GetIanaTarFile(iana_input_data_dir, 'data')
   iana_data_version = GetIanaVersion(iana_data_tar_file)
-  print 'IANA time zone data release %s in %s ...' % (iana_data_version, iana_data_tar_file)
+  print('IANA time zone data release %s in %s ...' % (iana_data_version, iana_data_tar_file))
 
   icu_dir = icuutil.icuDir()
-  print 'Found icu in %s ...' % icu_dir
+  print('Found icu in %s ...' % icu_dir)
 
   BuildIcuData(iana_data_tar_file)
 
@@ -238,14 +242,15 @@
   BuildTzdata(zic_binary_file, iana_data_dir, iana_data_version)
   BuildTzlookup(iana_data_dir)
 
-  # Create a distro file from the output from prior stages.
-  distro_output_dir = '%s/distro' % timezone_output_data_dir
-  CreateDistroFiles(iana_data_version, distro_output_dir)
+  # Create a distro file and version file from the output from prior stages.
+  output_distro_dir = '%s/distro' % timezone_output_data_dir
+  output_version_file = '%s/version/tz_version' % timezone_output_data_dir
+  CreateDistroFiles(iana_data_version, output_distro_dir, output_version_file)
 
   # Update test versions of distro files too.
   UpdateTestFiles()
 
-  print 'Look in %s and %s for new files' % (timezone_output_data_dir, icu_dir)
+  print('Look in %s and %s for new files' % (timezone_output_data_dir, icu_dir))
   sys.exit(0)