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

Unified Diff: chrome/android/BUILD.gn

Issue 2977993002: Reland of Deduplicate Monochrome locale .paks (Closed)
Patch Set: Created 3 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 | « no previous file | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/android/BUILD.gn
diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
index 9bdf03faec931bd9c0bba129bc6250ec30f09a36..ca5addba80a428e227d48e35757a382d765a6961 100644
--- a/chrome/android/BUILD.gn
+++ b/chrome/android/BUILD.gn
@@ -41,6 +41,10 @@ app_hooks_impl = "java/src/org/chromium/chrome/browser/AppHooksImpl.java"
if (enable_resource_whitelist_generation) {
monochrome_resource_whitelist =
"$target_gen_dir/monochrome_resource_whitelist.txt"
+ system_webview_locale_resource_id_list =
+ "$target_gen_dir/system_webview_locale_resource_id_list.txt"
+ monochrome_locale_whitelist =
+ "$target_gen_dir/monochrome_locale_whitelist.txt"
}
jinja_template("chrome_public_android_manifest") {
@@ -730,9 +734,66 @@ if (current_toolchain == default_toolchain) {
"/libmonochrome$shlib_extension.whitelist"
output = monochrome_resource_whitelist
}
+
+ # Use custom resource ID list instead of android_webview's compiler
+ # resource whitelist because //android_webview: generate_webui_resources
+ # and //android_webview: generate_components_resources use hand-written
+ # resource whitelists.
+ action("system_webview_locale_resource_id_list") {
+ script = "//tools/grit/pak_util.py"
+
+ _system_webview_en_US_locale_pak =
+ "$root_out_dir/android_webview/locales/en-US.pak"
+
+ inputs = [
+ _system_webview_en_US_locale_pak,
+ ]
+
+ outputs = [
+ system_webview_locale_resource_id_list,
+ ]
+
+ deps = [
+ "//android_webview:repack_locales",
+ ]
+
+ args = [
+ "list-id",
+ "--output",
+ rebase_path(system_webview_locale_resource_id_list, root_build_dir),
+ rebase_path(_system_webview_en_US_locale_pak, root_build_dir),
+ ]
+ }
+
+ action("monochrome_locale_whitelist") {
+ script = "//tools/resources/filter_resource_whitelist.py"
+
+ inputs = [
+ monochrome_resource_whitelist,
+ system_webview_locale_resource_id_list,
+ ]
+
+ outputs = [
+ monochrome_locale_whitelist,
+ ]
+
+ deps = [
+ ":monochrome_resource_whitelist",
+ ":system_webview_locale_resource_id_list",
+ "//android_webview:system_webview_pak_whitelist",
+ ]
+
+ args = [
+ "--input",
+ rebase_path(monochrome_resource_whitelist, root_build_dir),
+ "--filter",
+ rebase_path(system_webview_locale_resource_id_list, root_build_dir),
+ "--output",
+ rebase_path(monochrome_locale_whitelist, root_build_dir),
+ ]
+ }
}
- # This target does not output locale paks.
chrome_paks("monochrome_paks") {
output_dir = "$target_gen_dir/$target_name"
@@ -741,12 +802,25 @@ if (current_toolchain == default_toolchain) {
"//android_webview:generate_aw_resources",
]
- exclude_locale_paks = true
-
if (enable_resource_whitelist_generation) {
repack_whitelist = monochrome_resource_whitelist
deps += [ ":monochrome_resource_whitelist" ]
+ locale_whitelist = monochrome_locale_whitelist
+ deps += [ ":monochrome_locale_whitelist" ]
+ }
+ }
+
+ # This target is separate from monochrome_pak_assets because it does not
+ # disable compression.
+ android_assets("monochrome_locale_pak_assets") {
+ sources = []
+ foreach(_locale, locales - android_chrome_omitted_locales) {
+ sources += [ "$target_gen_dir/monochrome_paks/locales/$_locale.pak" ]
}
+
+ deps = [
+ ":monochrome_paks",
+ ]
}
# This target explicitly includes locale paks via deps.
@@ -758,7 +832,7 @@ if (current_toolchain == default_toolchain) {
disable_compression = true
deps = [
- ":chrome_public_locale_pak_assets",
+ ":monochrome_locale_pak_assets",
":monochrome_paks",
"//android_webview:locale_pak_assets",
]
« no previous file with comments | « no previous file | chrome/app/chrome_main_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698