mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
2fcafb65c5
Use defaults.bzl for the common macros PR Close #63383
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
load("//packages/common/locales:index.bzl", "LOCALES", "generate_all_locale_files", "generate_closure_locale_file")
|
|
load("//tools:defaults.bzl", "npm_package", "ts_project")
|
|
|
|
package(default_visibility = ["//visibility:public"])
|
|
|
|
# This generates the `closure-locale.ts` file through the `generate-locales` tool. Since
|
|
# the base locale file is checked-in for Google3, it is additionally stored in a golden location.
|
|
generate_closure_locale_file(
|
|
name = "closure_locale_file",
|
|
src = "closure-locale.ts",
|
|
)
|
|
|
|
generate_all_locale_files(
|
|
name = "locale_files",
|
|
)
|
|
|
|
ts_project(
|
|
name = "locales",
|
|
# TODO(devversion): Remove glob for checked-in legacy locale files that haven't been
|
|
# removed in the past (when CLDR has been updated). These can be removed in a major.
|
|
srcs = [file for l in LOCALES for file in [
|
|
"%s.ts" % l,
|
|
"extra/%s.ts" % l,
|
|
]] + glob(
|
|
[
|
|
"*.ts",
|
|
"extra/*.ts",
|
|
],
|
|
exclude = ["closure-locale.ts"],
|
|
),
|
|
)
|
|
|
|
npm_package(
|
|
# TODO(devversion): Remove glob for checked-in legacy locale files that haven't been
|
|
# removed in the past (when CLDR has been updated). These can be removed in a major.
|
|
srcs = ["global/%s.js" % l for l in LOCALES] + [
|
|
":locales",
|
|
":locales_types",
|
|
] + glob(["global/*.js"]),
|
|
)
|