| # Copyright 2019 The Fuchsia Authors. All rights reserved. |
| # Use of this source code is governed by a BSD-style license that can be |
| # found in the LICENSE file. |
| |
| import("//build/compiled_action.gni") |
| import("//src/lib/icu/tzdata/icu_tzdata_config_data.gni") |
| |
| # Generates a text file containing the revision ID (e.g. "2019c") of the time |
| # zone resource files. |
| # |
| # The resulting file is ASCII-encoded and contains a single unquoted string |
| # without any line breaks. It is written to |
| # `out/default/gen/src/lib/icu/tzdata/revision.txt`. |
| compiled_action("revision") { |
| tool = "//src/lib/icu/tools/extractor:icu_data_extractor" |
| |
| icu_data_file = "//third_party/icu/common/icudtl.dat" |
| tz_res_dir = "//third_party/icu/tzres/" |
| output_path = "${target_gen_dir}/revision.txt" |
| |
| sources = [ |
| icu_data_file, |
| ] |
| outputs = [ |
| output_path, |
| ] |
| |
| rebased_icu_data_file = rebase_path(icu_data_file) |
| rebased_tz_res_dir = rebase_path(tz_res_dir) |
| rebased_output_path = rebase_path(output_path) |
| |
| args = [ |
| "--icu-data-file=${rebased_icu_data_file}", |
| "--tz-res-dir=${rebased_tz_res_dir}", |
| "--output=${rebased_output_path}", |
| "tz-version", |
| ] |
| } |
| |
| # Template applies exactly the same tzdata settings for several sibling |
| # packages. The config name for target "foo" will be "icu_tzdata_for_foo". |
| template("_default_icu_tzdata") { |
| icu_tzdata_config_data("icu_tzdata_for_" + target_name) { |
| forward_variables_from(invoker, "*") |
| for_pkg = target_name |
| data_version = "44" |
| } |
| } |
| |
| icu_tzdata_config_data("icu_tzdata_for_flutter_runner_tests") { |
| for_pkg = "flutter_runner_tests" |
| data_version = "44" |
| } |
| |
| # This config package is intended for the test named 'base_icu_fuchsia_unittests' |
| # in out-of-tree, in Chromium. The test must have this package available when |
| # running in a Fuchsia environment, as it will attempt to load the appropriate |
| # library. |
| icu_tzdata_config_data("icu_tzdata_for_chromium_base_icu_fuchsia_unittests") { |
| for_pkg = "base_icu_fuchsia_unittests" |
| data_version = "44" |
| } |
| |
| # All the runners use exactly the same configs, so the data should dedupe |
| # exactly in pkgfs. |
| _default_icu_tzdata("dart_aot_product_runner") { |
| } |
| _default_icu_tzdata("dart_aot_runner") { |
| } |
| _default_icu_tzdata("dart_jit_product_runner") { |
| } |
| _default_icu_tzdata("dart_jit_runner") { |
| } |
| _default_icu_tzdata("flutter_aot_product_runner") { |
| } |
| _default_icu_tzdata("flutter_aot_runner") { |
| } |
| _default_icu_tzdata("flutter_jit_product_runner") { |
| } |
| _default_icu_tzdata("flutter_jit_runner") { |
| } |
| |
| group("config") { |
| public_deps = [ |
| ":icu_tzdata_for_chromium_base_icu_fuchsia_unittests", |
| ":icu_tzdata_for_dart_aot_product_runner", |
| ":icu_tzdata_for_dart_aot_runner", |
| ":icu_tzdata_for_dart_aot_runner", |
| ":icu_tzdata_for_dart_jit_product_runner", |
| ":icu_tzdata_for_dart_jit_runner", |
| ":icu_tzdata_for_flutter_aot_product_runner", |
| ":icu_tzdata_for_flutter_aot_runner", |
| ":icu_tzdata_for_flutter_jit_product_runner", |
| ":icu_tzdata_for_flutter_jit_runner", |
| ":icu_tzdata_for_flutter_runner_tests", |
| ] |
| } |