Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5182)

Unified Diff: chrome/chrome_repack_locales.gni

Issue 2124073002: Upstream monochrome repack locales (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comment Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/android/monochrome_repack_locales.gni ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/chrome_repack_locales.gni
diff --git a/chrome/chrome_repack_locales.gni b/chrome/chrome_repack_locales.gni
index 9601dd4eb85da1c588a66f9b5954a09cafe9c2ff..54559c7658b4eb67623e14601f471c3ac157cf1e 100644
--- a/chrome/chrome_repack_locales.gni
+++ b/chrome/chrome_repack_locales.gni
@@ -17,6 +17,19 @@ import("//tools/grit/repack.gni")
#
# visibility
# Normal meaning.
+#
+# additional_source_patterns
+# The pattern of additional pak files which need repacked, the name of
+# pak always ends with '_${locale}.pak' e.g. foo_zh-CN.pak, since the
+# locale is argument of template, the sources in this list should be
+# the file name without '_${locale}.pak', tempate expands sources to
+# the full name, e.g
+# ${root_gen_dir}/foo expands to ${root_gen_dir}/foo_zh-CN.pak
+# when locale is zh-CN.
+#
+# additional_deps
+# The corresponding deps of additonal_source_patterns.
+#
template("_repack_one_locale") {
locale = invoker.locale
@@ -44,6 +57,12 @@ template("_repack_one_locale") {
sources += [ "${root_gen_dir}/chrome/settings_strings.pak" ]
deps += [ "//chrome/app:settings_strings" ]
+ if (defined(invoker.additional_source_patterns)) {
+ sources += process_file_template(invoker.additional_source_patterns,
+ [ "{{source}}_${locale}.pak" ])
+ deps += invoker.additional_deps
+ }
+
if (use_ash) {
sources += [ "${root_gen_dir}/ash/strings/ash_strings_${locale}.pak" ]
deps += [ "//ash/strings" ]
@@ -132,6 +151,16 @@ template("_repack_one_locale") {
# input names. Mac uses different names in some cases.
#
# visibility
+#
+# additional_source_patterns
+# Pass to template("_repack_one_locale")
+#
+# additional_deps
+# Pass to template("_repack_one_locale")
+#
+# output_dir
+# this is used to override default output dir.
+#
template("chrome_repack_locales") {
# This is the name of the group below that will collect all the invidual
# locale targets. External targets will depend on this.
@@ -160,11 +189,18 @@ template("chrome_repack_locales") {
locale = input_locale
# Compute the output name. Mac uses a different location.
- if (is_mac || is_ios) {
+ if (defined(invoker.output_dir)) {
+ output = "${invoker.output_dir}/${output_locale}.pak"
+ } else if (is_mac || is_ios) {
output = "${root_gen_dir}/repack/locales/${output_locale}.pak"
} else {
output = "${root_out_dir}/locales/${output_locale}.pak"
}
+
+ if (defined(invoker.additional_source_patterns)) {
+ additional_source_patterns = invoker.additional_source_patterns
+ additional_deps = invoker.additional_deps
+ }
}
current_index = current_index + 1
« no previous file with comments | « chrome/android/monochrome_repack_locales.gni ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698