blob: ac4169033f633bc20c1ca1f9e4d0133af55f4101 [file] [log] [blame]
# Copyright 2020 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/components.gni")
import("//build/icu/icu_rustc_staticlib.gni")
import("//build/intl/intl_strings.gni")
import("//build/rust/rustc_staticlib.gni")
import("//build/testing/environments.gni")
import("//src/lib/icu/third_party_icu_headers.gni")
group("rust") {
testonly = true
public_deps = [
":lib",
":tests",
]
}
group("tests") {
testonly = true
public_deps = [ ":intl-lookup-rust-tests" ]
}
icu_rustc_staticlib("lib") {
with_unit_tests = true
name = "intl_lookup"
edition = "2021"
public = [ "lookup.h" ]
icu_deps = [
"//src/lib/icu_data/rust/icu_data",
"//third_party/rust_crates:rust_icu_common",
"//third_party/rust_crates:rust_icu_sys",
"//third_party/rust_crates:rust_icu_uloc",
]
deps = [
"//src/lib/intl/model:lib",
"//third_party/rust_crates:anyhow",
"//third_party/rust_crates:libc",
"//third_party/rust_crates:tracing",
]
non_rust_deps = [ "//zircon/system/ulib/zx" ]
test_deps = [
":fuchsia.intl.test_rust",
":l10n",
]
sources = [ "src/lib.rs" ]
}
resource("l10n_en_asset") {
deps = [ ":l10n" ]
sources = [ "$target_gen_dir/en/l10n.json" ]
outputs = [ "data/assets/locales/en/l10n.json" ]
}
resource("l10n_fr_asset") {
deps = [ ":l10n" ]
sources = [ "$target_gen_dir/fr/l10n.json" ]
outputs = [ "data/assets/locales/fr/l10n.json" ]
}
resource("l10n_es_asset") {
deps = [ ":l10n" ]
sources = [ "$target_gen_dir/es/l10n.json" ]
outputs = [ "data/assets/locales/es/l10n.json" ]
}
fuchsia_unittest_package("intl-lookup-rust-tests") {
deps = [
":l10n_en_asset",
":l10n_es_asset",
":l10n_fr_asset",
":lib_test",
"//src/intl:icudtl",
]
}
intl_strings("l10n") {
source = "strings.xml"
source_locale = "en"
output_locales = [
"en",
"fr",
"es",
]
library = "fuchsia.intl.test"
# Allow keeping files like strings_fr.xml in the same directory as
# strings.xml. This is for testing only, we recommend not using this
# option and using a separate directory per locale instead.
same_dir_locales = true
}