xref: /aosp_15_r20/external/timezone-boundary-builder/android/README.md (revision f0df97945b4fdddd066170b120f192941b8d7fbf)
1*f0df9794SNeil FullerThis directory contains Android's additions to timezone-boundary-builder
2*f0df9794SNeil Fullerproject.
3*f0df9794SNeil Fuller
4*f0df9794SNeil FullerDirectories:
5*f0df9794SNeil Fuller
6*f0df9794SNeil Fuller`android_inputs/`
7*f0df9794SNeil Fuller  - Files downloaded from upstream to seed `android_downloads/`
8*f0df9794SNeil Fuller
9*f0df9794SNeil Fuller`android_downloads/`
10*f0df9794SNeil Fuller  - The .json files used to generate the output. Equivalent to upstream's
11*f0df9794SNeil Fuller    `downloads/` directory.
12*f0df9794SNeil Fuller
13*f0df9794SNeil Fuller`android_dist/`
14*f0df9794SNeil Fuller  - The generated output files. Equivalent to upstream's `dist/` directory.
15*f0df9794SNeil Fuller
16*f0df9794SNeil Fuller`tools/`
17*f0df9794SNeil Fuller  - Scripts used to execute the timezone-boundary-builder generation process.
18*f0df9794SNeil Fuller
19*f0df9794SNeil FullerAndroid initially intends to use the time zone boundary file, `combined.json`,
20*f0df9794SNeil Fullerreleased by upstream. Therefore, this copy of timezone-boundary-builder may be
21*f0df9794SNeil Fullerunnecessary until / unless Android wants to make local modifications.
22*f0df9794SNeil Fuller
23*f0df9794SNeil Fuller-----
24*f0df9794SNeil Fuller
25*f0df9794SNeil FullerThe `combined.json` generation process:
26*f0df9794SNeil Fuller
27*f0df9794SNeil FullerExecute `android/tools/host/clear_android_data_files.sh` to clear out most
28*f0df9794SNeil Fullerworking files and reset the local environment.
29*f0df9794SNeil Fuller
30*f0df9794SNeil FullerBefore running the generation process, decide if you want to use the same input
31*f0df9794SNeil Fullerfiles as have been used by upstream.
32*f0df9794SNeil Fuller
33*f0df9794SNeil FullerUpstream make the files used available in a file called `input-files.zip`, which
34*f0df9794SNeil Fullercan be downloaded and unpacked into the `android/android_downloads/` directory
35*f0df9794SNeil Fullerusing `android/tools/host/download_input_files.sh`.
36*f0df9794SNeil Fuller
37*f0df9794SNeil FullerWhen not using upstream's input files, the generation process will first
38*f0df9794SNeil Fullerdownload boundary data from OpenStreetMap, which is slow. Because OpenStreetMap
39*f0df9794SNeil Fulleris constantly evolving, the latest features downloaded will usually have issues
40*f0df9794SNeil Fullerthat need to be fixed before proceeding. The script can be restarted multiple
41*f0df9794SNeil Fullertimes and will usually restart downloads from where it failed last time.
42*f0df9794SNeil Fuller
43*f0df9794SNeil FullerLocal edits to input files may be necessary to make adjustments needed for
44*f0df9794SNeil FullerAndroid in future.
45*f0df9794SNeil Fuller
46*f0df9794SNeil Fullertimezone-boundary-builder requires the nodejs runtime for execution with various
47*f0df9794SNeil Fullerdependencies, so Android's `android/tools/host/run_tzbb.sh` uses a Docker
48*f0df9794SNeil Fullercontainer to setup the runtime environment in a repeatable manner.
49*f0df9794SNeil Fuller
50*f0df9794SNeil FullerExecute `android/tools/host/run_tzbb.sh --help` to see options.
51*f0df9794SNeil Fuller
52*f0df9794SNeil FullerThe following can be used to speed up generation times:
53*f0df9794SNeil Fuller
54*f0df9794SNeil Fuller```
55*f0df9794SNeil Fuller      --skip_analyze_diffs  Skip analysis of diffs between versions    [boolean]
56*f0df9794SNeil Fuller      --skip_shapefile      Skip shapefile creation                    [boolean]
57*f0df9794SNeil Fuller      --skip_validation     Skip validation                            [boolean]
58*f0df9794SNeil Fuller```
59*f0df9794SNeil Fuller
60*f0df9794SNeil FullerAfter executing `android/tools/host/run_tzdbb.sh`, in `android/android_dist/`
61*f0df9794SNeil Fullerthere will be many .json files alongside (a newly generated) `input-files.zip`
62*f0df9794SNeil Fullerand `combined.json` that constitute the main output files.
63*f0df9794SNeil Fuller
64*f0df9794SNeil FullerThe contents of `android/android_downloads/` and `android/android_dist/` can be
65*f0df9794SNeil Fullercommitted to form a full record of how the latest output file was generated.
66*f0df9794SNeil Fuller
67*f0df9794SNeil FullerThe `combined.json` and `input-files.zip` can be passed to the new step of the
68*f0df9794SNeil Fullerreference data generation pipeline, which is held in a separate git project.
69*f0df9794SNeil Fuller
70