• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
16package {
17    // See: http://go/android-license-faq
18    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    ],
36}
37
38java_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",
55        "geotz_host_common",
56        "geotz_s2storage_tools_protos",
57        "guava",
58        "jcommander",
59        "libprotobuf-java-full",
60        "s2-geometry-library-java",
61        "tzids",
62        "tztools_common",
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.
70java_binary_host {
71    name: "geotz_geojsontz_to_tzs2polygons",
72    main_class: "com.android.timezone.location.data_pipeline.steps.GeoJsonTzToTzS2Polygons",
73    static_libs: ["geotz_data_pipeline"],
74}
75
76// Step 2 of the OSM time zone geolocation reference data pipeline.
77//
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.
80java_binary_host {
81    name: "geotz_canonicalize_tzs2polygons",
82    main_class: "com.android.timezone.location.data_pipeline.steps.CanonicalizeTzS2Polygons",
83    static_libs: ["geotz_data_pipeline"],
84}
85
86// Step 3 of the OSM time zone geolocation reference data pipeline.
87//
88// Converts TzS2Polygon proto files to TsS2CellUnion proto files at a maximum S2 level.
89java_binary_host {
90    name: "geotz_tzs2polygons_to_tzs2cellunions",
91    main_class: "com.android.timezone.location.data_pipeline.steps.TzS2PolygonsToTzS2CellUnions",
92    static_libs: ["geotz_data_pipeline"],
93}
94
95// Step 4 of the OSM time zone geolocation reference data pipeline.
96//
97// Converts TsS2CellUnion proto files to (single time zone) TzS2Ranges proto files.
98java_binary_host {
99    name: "geotz_tzs2cellunions_to_tzs2ranges",
100    main_class: "com.android.timezone.location.data_pipeline.steps.TzS2CellUnionsToTzS2Ranges",
101    static_libs: ["geotz_data_pipeline"],
102}
103
104// Step 5 of the OSM time zone geolocation reference data pipeline.
105//
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",
110    main_class: "com.android.timezone.location.data_pipeline.steps.MergeTzS2Ranges",
111    static_libs: ["geotz_data_pipeline"],
112}
113
114// Step 6 of the OSM time zone geolocation reference data pipeline.
115//
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",
120    main_class: "com.android.timezone.location.data_pipeline.steps.CreateTzS2ProtoDataFile",
121    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",
136    main_class: "com.android.timezone.location.data_pipeline.tools.PrintTzS2RangeStats",
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.
141java_binary_host {
142    name: "geotz_data_pipeline_debug_printtzs2cellunionstats",
143    main_class: "com.android.timezone.location.data_pipeline.tools.PrintTzS2CellUnionStats",
144    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    ],
156}
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}
168