blob: 17257776858dd0e197c8749ae6f6aa774312d592 [file] [log] [blame]
Neil Fullerdd2ad852020-07-31 15:05:59 +01001// 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 Badour7504dcc2021-03-26 18:07:03 -070016package {
17 // See: http://go/android-license-faq
Bob Badour6e26eee2022-01-24 17:07:49 -080018 default_applicable_licenses: [
19 "Android-Apache-2.0",
20 "packages_modules_GeoTZ_data_pipeline_license",
21 ],
22}
23
24license {
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 Badour7504dcc2021-03-26 18:07:03 -070036}
37
Neil Fullerdd2ad852020-07-31 15:05:59 +010038java_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.
49java_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 Fuller6b079862021-05-24 14:33:50 +010055 "geotz_host_common",
Neil Fullerdd2ad852020-07-31 15:05:59 +010056 "geotz_s2storage_tools_protos",
Almaz Mingaleeva46d74d2020-11-10 10:29:39 +000057 "guava",
Almaz Mingaleev3d053b52021-02-11 14:19:19 +000058 "jcommander",
Neil Fullerdd2ad852020-07-31 15:05:59 +010059 "libprotobuf-java-full",
60 "s2-geometry-library-java",
Neil Fuller51a3f312020-08-07 21:53:47 +010061 "tzids",
62 "tztools_common",
Neil Fullerdd2ad852020-07-31 15:05:59 +010063 ],
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.
70java_binary_host {
71 name: "geotz_geojsontz_to_tzs2polygons",
Neil Fuller9835a8a2021-01-25 19:17:58 +000072 main_class: "com.android.timezone.location.data_pipeline.steps.GeoJsonTzToTzS2Polygons",
Neil Fullerdd2ad852020-07-31 15:05:59 +010073 static_libs: ["geotz_data_pipeline"],
74}
75
76// Step 2 of the OSM time zone geolocation reference data pipeline.
77//
Neil Fuller51a3f312020-08-07 21:53:47 +010078// 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.
80java_binary_host {
81 name: "geotz_canonicalize_tzs2polygons",
Neil Fuller9835a8a2021-01-25 19:17:58 +000082 main_class: "com.android.timezone.location.data_pipeline.steps.CanonicalizeTzS2Polygons",
Neil Fuller51a3f312020-08-07 21:53:47 +010083 static_libs: ["geotz_data_pipeline"],
84}
85
86// Step 3 of the OSM time zone geolocation reference data pipeline.
87//
Neil Fullerdd2ad852020-07-31 15:05:59 +010088// Converts TzS2Polygon proto files to TsS2CellUnion proto files at a maximum S2 level.
89java_binary_host {
90 name: "geotz_tzs2polygons_to_tzs2cellunions",
Neil Fuller9835a8a2021-01-25 19:17:58 +000091 main_class: "com.android.timezone.location.data_pipeline.steps.TzS2PolygonsToTzS2CellUnions",
Neil Fullerdd2ad852020-07-31 15:05:59 +010092 static_libs: ["geotz_data_pipeline"],
93}
94
Neil Fuller51a3f312020-08-07 21:53:47 +010095// Step 4 of the OSM time zone geolocation reference data pipeline.
Neil Fullerdd2ad852020-07-31 15:05:59 +010096//
97// Converts TsS2CellUnion proto files to (single time zone) TzS2Ranges proto files.
98java_binary_host {
99 name: "geotz_tzs2cellunions_to_tzs2ranges",
Neil Fuller9835a8a2021-01-25 19:17:58 +0000100 main_class: "com.android.timezone.location.data_pipeline.steps.TzS2CellUnionsToTzS2Ranges",
Neil Fullerdd2ad852020-07-31 15:05:59 +0100101 static_libs: ["geotz_data_pipeline"],
102}
103
Neil Fuller51a3f312020-08-07 21:53:47 +0100104// Step 5 of the OSM time zone geolocation reference data pipeline.
Neil Fullerdd2ad852020-07-31 15:05:59 +0100105//
106// Merges multiple, single time zone TzS2Ranges proto files into one, multiple time zone TzS2Ranges
107// proto file
108java_binary_host {
109 name: "geotz_mergetzs2ranges",
Neil Fuller9835a8a2021-01-25 19:17:58 +0000110 main_class: "com.android.timezone.location.data_pipeline.steps.MergeTzS2Ranges",
Neil Fullerdd2ad852020-07-31 15:05:59 +0100111 static_libs: ["geotz_data_pipeline"],
112}
113
Neil Fuller51a3f312020-08-07 21:53:47 +0100114// Step 6 of the OSM time zone geolocation reference data pipeline.
Neil Fullerdd2ad852020-07-31 15:05:59 +0100115//
116// Converts the one, multiple time zone TzS2Ranges proto file to the file format required by the
117// geotz_createtzs2file tool.
118java_binary_host {
119 name: "geotz_createtzs2fileinput",
Neil Fuller9835a8a2021-01-25 19:17:58 +0000120 main_class: "com.android.timezone.location.data_pipeline.steps.CreateTzS2ProtoDataFile",
Neil Fullerdd2ad852020-07-31 15:05:59 +0100121 static_libs: ["geotz_data_pipeline"],
122}
123
124// A library containing debug tooling. See java_binary_host definitions below for details.
125java_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.
134java_binary_host {
135 name: "geotz_data_pipeline_debug_printtzs2rangesstats",
Neil Fuller9835a8a2021-01-25 19:17:58 +0000136 main_class: "com.android.timezone.location.data_pipeline.tools.PrintTzS2RangeStats",
Neil Fullerdd2ad852020-07-31 15:05:59 +0100137 static_libs: ["geotz_data_pipeline_debug"],
138}
139
140// Dev / debug tool: Prints basic stats about TzS2CellUnion files. See the Java class for details.
141java_binary_host {
142 name: "geotz_data_pipeline_debug_printtzs2cellunionstats",
Neil Fuller9835a8a2021-01-25 19:17:58 +0000143 main_class: "com.android.timezone.location.data_pipeline.tools.PrintTzS2CellUnionStats",
Neil Fullerdd2ad852020-07-31 15:05:59 +0100144 static_libs: ["geotz_data_pipeline_debug"],
145}
146
147// Tests for the pipeline steps.
148java_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 Fullerdd2ad852020-07-31 15:05:59 +0100156}
157
158// A host library containing geojson-jackson and all its dependencies.
159java_library_host {
160 name: "geotz_geojson",
161 static_libs: [
162 "geojson-jackson",
163 "jackson-annotations",
164 "jackson-core",
165 "jackson-databind",
166 ],
167}