Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 1 | // Copyright (C) 2020 The Android Open Source Project |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | // you may not use this file except in compliance with the License. |
| 5 | // You may obtain a copy of the License at |
| 6 | // |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | // |
| 9 | // Unless required by applicable law or agreed to in writing, software |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | // See the License for the specific language governing permissions and |
| 13 | // limitations under the License. |
| 14 | |
| 15 | // Proto library |
Bob Badour | 7504dcc | 2021-03-26 18:07:03 -0700 | [diff] [blame] | 16 | package { |
| 17 | // See: http://go/android-license-faq |
Bob Badour | 6e26eee | 2022-01-24 17:07:49 -0800 | [diff] [blame] | 18 | default_applicable_licenses: [ |
| 19 | "Android-Apache-2.0", |
| 20 | "packages_modules_GeoTZ_data_pipeline_license", |
| 21 | ], |
| 22 | } |
| 23 | |
| 24 | license { |
| 25 | name: "packages_modules_GeoTZ_data_pipeline_license", |
| 26 | license_kinds: ["legacy_restricted"], |
| 27 | license_text: [ |
| 28 | "src/test/java/com/android/timezone/location/data_pipeline/steps/canonicalizetzs2polygons/data/input_polygons/LICENSE", |
| 29 | "src/test/java/com/android/timezone/location/data_pipeline/steps/canonicalizetzs2polygons/data/output_polygons/LICENSE", |
| 30 | "src/test/java/com/android/timezone/location/data_pipeline/steps/createtzs2protodatafile/data/LICENSE", |
| 31 | "src/test/java/com/android/timezone/location/data_pipeline/steps/geojsontz_to_tzs2polygons/data/LICENSE", |
| 32 | "src/test/java/com/android/timezone/location/data_pipeline/steps/mergetzs2ranges/data/LICENSE", |
| 33 | "src/test/java/com/android/timezone/location/data_pipeline/steps/tzs2cellunions_to_tzs2ranges/data/LICENSE", |
| 34 | "src/test/java/com/android/timezone/location/data_pipeline/steps/tzs2polygons_tzs2cellunions/data/LICENSE", |
| 35 | ], |
Bob Badour | 7504dcc | 2021-03-26 18:07:03 -0700 | [diff] [blame] | 36 | } |
| 37 | |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 38 | java_library_host { |
| 39 | name: "geotz_data_pipeline_protos", |
| 40 | proto: { |
| 41 | type: "full", |
| 42 | include_dirs: ["external/protobuf/src"], |
| 43 | }, |
| 44 | |
| 45 | srcs: ["src/main/proto/**/*.proto"], |
| 46 | } |
| 47 | |
| 48 | // A library containing the code for the pipeline steps defined below. |
| 49 | java_library_host { |
| 50 | name: "geotz_data_pipeline", |
| 51 | srcs: ["src/main/java/**/*.java"], |
| 52 | static_libs: [ |
| 53 | "geotz_data_pipeline_protos", |
| 54 | "geotz_geojson", |
Neil Fuller | 6b07986 | 2021-05-24 14:33:50 +0100 | [diff] [blame] | 55 | "geotz_host_common", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 56 | "geotz_s2storage_tools_protos", |
Almaz Mingaleev | a46d74d | 2020-11-10 10:29:39 +0000 | [diff] [blame] | 57 | "guava", |
Almaz Mingaleev | 3d053b5 | 2021-02-11 14:19:19 +0000 | [diff] [blame] | 58 | "jcommander", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 59 | "libprotobuf-java-full", |
| 60 | "s2-geometry-library-java", |
Neil Fuller | 51a3f31 | 2020-08-07 21:53:47 +0100 | [diff] [blame] | 61 | "tzids", |
| 62 | "tztools_common", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 63 | ], |
| 64 | } |
| 65 | |
| 66 | // Step 1 of the OSM time zone geolocation reference data pipeline. |
| 67 | // |
| 68 | // Converts geojson time zone boundaries (from timezone-boundary-builder) to TzS2Polygon proto |
| 69 | // files, one per time zone ID. |
| 70 | java_binary_host { |
| 71 | name: "geotz_geojsontz_to_tzs2polygons", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 72 | main_class: "com.android.timezone.location.data_pipeline.steps.GeoJsonTzToTzS2Polygons", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 73 | static_libs: ["geotz_data_pipeline"], |
| 74 | } |
| 75 | |
| 76 | // Step 2 of the OSM time zone geolocation reference data pipeline. |
| 77 | // |
Neil Fuller | 51a3f31 | 2020-08-07 21:53:47 +0100 | [diff] [blame] | 78 | // Reads TzS2Polygon proto files and writes out TzS2Polygon proto files with canonical time zone |
| 79 | // IDs, combining multiple input files into output files where necessary. |
| 80 | java_binary_host { |
| 81 | name: "geotz_canonicalize_tzs2polygons", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 82 | main_class: "com.android.timezone.location.data_pipeline.steps.CanonicalizeTzS2Polygons", |
Neil Fuller | 51a3f31 | 2020-08-07 21:53:47 +0100 | [diff] [blame] | 83 | static_libs: ["geotz_data_pipeline"], |
| 84 | } |
| 85 | |
| 86 | // Step 3 of the OSM time zone geolocation reference data pipeline. |
| 87 | // |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 88 | // Converts TzS2Polygon proto files to TsS2CellUnion proto files at a maximum S2 level. |
| 89 | java_binary_host { |
| 90 | name: "geotz_tzs2polygons_to_tzs2cellunions", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 91 | main_class: "com.android.timezone.location.data_pipeline.steps.TzS2PolygonsToTzS2CellUnions", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 92 | static_libs: ["geotz_data_pipeline"], |
| 93 | } |
| 94 | |
Neil Fuller | 51a3f31 | 2020-08-07 21:53:47 +0100 | [diff] [blame] | 95 | // Step 4 of the OSM time zone geolocation reference data pipeline. |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 96 | // |
| 97 | // Converts TsS2CellUnion proto files to (single time zone) TzS2Ranges proto files. |
| 98 | java_binary_host { |
| 99 | name: "geotz_tzs2cellunions_to_tzs2ranges", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 100 | main_class: "com.android.timezone.location.data_pipeline.steps.TzS2CellUnionsToTzS2Ranges", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 101 | static_libs: ["geotz_data_pipeline"], |
| 102 | } |
| 103 | |
Neil Fuller | 51a3f31 | 2020-08-07 21:53:47 +0100 | [diff] [blame] | 104 | // Step 5 of the OSM time zone geolocation reference data pipeline. |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 105 | // |
| 106 | // Merges multiple, single time zone TzS2Ranges proto files into one, multiple time zone TzS2Ranges |
| 107 | // proto file |
| 108 | java_binary_host { |
| 109 | name: "geotz_mergetzs2ranges", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 110 | main_class: "com.android.timezone.location.data_pipeline.steps.MergeTzS2Ranges", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 111 | static_libs: ["geotz_data_pipeline"], |
| 112 | } |
| 113 | |
Neil Fuller | 51a3f31 | 2020-08-07 21:53:47 +0100 | [diff] [blame] | 114 | // Step 6 of the OSM time zone geolocation reference data pipeline. |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 115 | // |
| 116 | // Converts the one, multiple time zone TzS2Ranges proto file to the file format required by the |
| 117 | // geotz_createtzs2file tool. |
| 118 | java_binary_host { |
| 119 | name: "geotz_createtzs2fileinput", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 120 | main_class: "com.android.timezone.location.data_pipeline.steps.CreateTzS2ProtoDataFile", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 121 | static_libs: ["geotz_data_pipeline"], |
| 122 | } |
| 123 | |
| 124 | // A library containing debug tooling. See java_binary_host definitions below for details. |
| 125 | java_library_host { |
| 126 | name: "geotz_data_pipeline_debug", |
| 127 | srcs: ["src/debug/java/**/*.java"], |
| 128 | static_libs: [ |
| 129 | "geotz_data_pipeline", |
| 130 | ], |
| 131 | } |
| 132 | |
| 133 | // Dev / debug tool: Prints basic stats about TzS2Range files. See the Java class for details. |
| 134 | java_binary_host { |
| 135 | name: "geotz_data_pipeline_debug_printtzs2rangesstats", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 136 | main_class: "com.android.timezone.location.data_pipeline.tools.PrintTzS2RangeStats", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 137 | static_libs: ["geotz_data_pipeline_debug"], |
| 138 | } |
| 139 | |
| 140 | // Dev / debug tool: Prints basic stats about TzS2CellUnion files. See the Java class for details. |
| 141 | java_binary_host { |
| 142 | name: "geotz_data_pipeline_debug_printtzs2cellunionstats", |
Neil Fuller | 9835a8a | 2021-01-25 19:17:58 +0000 | [diff] [blame] | 143 | main_class: "com.android.timezone.location.data_pipeline.tools.PrintTzS2CellUnionStats", |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 144 | static_libs: ["geotz_data_pipeline_debug"], |
| 145 | } |
| 146 | |
| 147 | // Tests for the pipeline steps. |
| 148 | java_test_host { |
| 149 | name: "geotz_data_pipeline_tests", |
| 150 | srcs: ["src/test/java/**/*.java"], |
| 151 | java_resource_dirs: ["src/test/java/"], |
| 152 | static_libs: [ |
| 153 | "geotz_data_pipeline", |
| 154 | "junit", |
| 155 | ], |
Neil Fuller | dd2ad85 | 2020-07-31 15:05:59 +0100 | [diff] [blame] | 156 | } |
| 157 | |
| 158 | // A host library containing geojson-jackson and all its dependencies. |
| 159 | java_library_host { |
| 160 | name: "geotz_geojson", |
| 161 | static_libs: [ |
| 162 | "geojson-jackson", |
| 163 | "jackson-annotations", |
| 164 | "jackson-core", |
| 165 | "jackson-databind", |
| 166 | ], |
| 167 | } |