| Index: chrome/BUILD.gn
|
| diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
|
| index 9c4e7d66359bafa631562e82e8d309477f2a6f1b..8ddd74bb8a7a6cf025876d731a17514a5dd8a286 100644
|
| --- a/chrome/BUILD.gn
|
| +++ b/chrome/BUILD.gn
|
| @@ -11,12 +11,16 @@
|
| import("//build/config/ui.gni")
|
| import("//build/config/win/console_app.gni")
|
| import("//build/config/win/manifest.gni")
|
| -import("//chrome/chrome_paks.gni")
|
| +import("//chrome/chrome_repack_locales.gni")
|
| import("//chrome/common/features.gni")
|
| import("//chrome/version.gni")
|
| import("//third_party/widevine/cdm/widevine.gni")
|
| import("//ui/base/ui_features.gni")
|
| import("//v8/gni/v8.gni")
|
| +
|
| +if (enable_resource_whitelist_generation) {
|
| + android_resource_whitelist = "$root_gen_dir/chrome/resource_whitelist.txt"
|
| +}
|
|
|
| if (is_android) {
|
| import("//build/config/android/rules.gni")
|
| @@ -30,10 +34,6 @@
|
| import("//build_overrides/v8.gni")
|
| import("//media/cdm/ppapi/cdm_paths.gni")
|
| import("//third_party/icu/config.gni")
|
| -}
|
| -
|
| -if (enable_resource_whitelist_generation) {
|
| - chrome_resource_whitelist = "$target_gen_dir/chrome_resource_whitelist.txt"
|
| }
|
|
|
| if (is_win) {
|
| @@ -997,7 +997,7 @@
|
| ":chrome_framework_helpers",
|
| ":chrome_framework_plugins",
|
| ":chrome_framework_resources",
|
| - ":packed_resources",
|
| + ":repack_locales_pack",
|
| ":widevine_cdm_library",
|
| "//build/config/sanitizers:deps",
|
| "//chrome/app/nibs:chrome_xibs",
|
| @@ -1340,40 +1340,100 @@
|
| }
|
| }
|
|
|
| -chrome_paks("packed_resources") {
|
| - if (is_mac) {
|
| - output_dir = "$root_gen_dir/repack"
|
| - copy_data_to_bundle = true
|
| - } else {
|
| - output_dir = root_out_dir
|
| - }
|
| -
|
| - if (enable_resource_whitelist_generation) {
|
| - repack_whitelist = chrome_resource_whitelist
|
| - deps = [
|
| - "//chrome:resource_whitelist",
|
| - ]
|
| - }
|
| +group("packed_resources") {
|
| + public_deps = [
|
| + ":repack_chrome_100_percent",
|
| + ":repack_locales_pack",
|
| + ]
|
|
|
| if (is_chrome_branded && !is_mac && !is_android) {
|
| public_deps += [ ":default_apps" ]
|
| }
|
| -}
|
| -
|
| -chrome_extra_paks("packed_extra_resources") {
|
| +
|
| + if (enable_hidpi) {
|
| + public_deps += [ ":repack_chrome_200_percent" ]
|
| + }
|
| +}
|
| +
|
| +repack("packed_extra_resources") {
|
| + visibility = [ "./*" ]
|
| + sources = [
|
| + "$root_gen_dir/blink/public/resources/blink_resources.pak",
|
| + "$root_gen_dir/chrome/browser_resources.pak",
|
| + "$root_gen_dir/chrome/chrome_unscaled_resources.pak",
|
| + "$root_gen_dir/chrome/common_resources.pak",
|
| + "$root_gen_dir/chrome/invalidations_resources.pak",
|
| + "$root_gen_dir/chrome/net_internals_resources.pak",
|
| + "$root_gen_dir/chrome/password_manager_internals_resources.pak",
|
| + "$root_gen_dir/chrome/policy_resources.pak",
|
| + "$root_gen_dir/chrome/translate_internals_resources.pak",
|
| + "$root_gen_dir/components/components_resources.pak",
|
| + "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
| + "$root_gen_dir/content/content_resources.pak",
|
| + "$root_gen_dir/net/net_resources.pak",
|
| + "$root_gen_dir/ui/resources/webui_resources.pak",
|
| + ]
|
| + deps = [
|
| + "//chrome/app/theme:chrome_unscaled_resources",
|
| + "//chrome/browser:resources",
|
| + "//chrome/browser/resources:invalidations_resources",
|
| + "//chrome/browser/resources:net_internals_resources",
|
| + "//chrome/browser/resources:password_manager_internals_resources",
|
| + "//chrome/browser/resources:policy_resources",
|
| + "//chrome/browser/resources:translate_internals_resources",
|
| + "//chrome/common:resources",
|
| + "//components/resources",
|
| + "//content:resources",
|
| + "//content/browser/tracing:resources",
|
| + "//net:net_resources",
|
| + "//third_party/WebKit/public:resources",
|
| + "//ui/resources",
|
| + ]
|
| +
|
| + if (is_android) {
|
| + sources += [ "$root_gen_dir/android_webview/aw_resources.pak" ]
|
| + deps += [ "//android_webview:generate_aw_resources" ]
|
| + } else { # Non-Android.
|
| + # New paks should be added here by default.
|
| + sources += [
|
| + "$root_gen_dir/blink/devtools_resources.pak",
|
| + "$root_gen_dir/chrome/component_extension_resources.pak",
|
| + "$root_gen_dir/chrome/options_resources.pak",
|
| + "$root_gen_dir/chrome/quota_internals_resources.pak",
|
| + "$root_gen_dir/chrome/settings_resources.pak",
|
| + "$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
|
| + ]
|
| + deps += [
|
| + "//chrome/browser/resources:component_extension_resources",
|
| + "//chrome/browser/resources:options_resources",
|
| + "//chrome/browser/resources:quota_internals_resources",
|
| + "//chrome/browser/resources:settings_resources",
|
| + "//chrome/browser/resources:sync_file_system_internals_resources",
|
| + "//content/browser/devtools:devtools_resources",
|
| + ]
|
| + }
|
| + if (is_chromeos) {
|
| + sources += [ "$root_gen_dir/ui/file_manager/file_manager_resources.pak" ]
|
| + deps += [ "//ui/file_manager:resources" ]
|
| + }
|
| + if (enable_extensions) {
|
| + sources += [
|
| + "$root_gen_dir/extensions/extensions_renderer_resources.pak",
|
| + "$root_gen_dir/extensions/extensions_resources.pak",
|
| + ]
|
| + deps += [ "//extensions:extensions_resources" ]
|
| + }
|
| +
|
| if (is_mac) {
|
| - output_dir = "$root_gen_dir/repack"
|
| - copy_data_to_bundle = true
|
| + output = "$root_gen_dir/repack/resources.pak"
|
| } else {
|
| - output_dir = root_out_dir
|
| + output = "$root_out_dir/resources.pak"
|
| }
|
|
|
| copy_data_to_bundle = is_mac
|
| if (enable_resource_whitelist_generation) {
|
| - repack_whitelist = chrome_resource_whitelist
|
| - deps = [
|
| - ":resource_whitelist",
|
| - ]
|
| + repack_whitelist = android_resource_whitelist
|
| + deps += [ ":resource_whitelist" ]
|
| }
|
| }
|
|
|
| @@ -1390,6 +1450,127 @@
|
| ]
|
| }
|
|
|
| +# Collects per-locale grit files from many sources into global per-locale files.
|
| +chrome_repack_locales("repack_locales_pack") {
|
| + visibility = [ ":*" ]
|
| +
|
| + input_locales = locales
|
| + copy_data_to_bundle = is_mac
|
| +
|
| + if (is_mac) {
|
| + output_locales = locales_as_mac_outputs
|
| + } else {
|
| + output_locales = locales
|
| + }
|
| +
|
| + if (enable_resource_whitelist_generation) {
|
| + repack_whitelist = android_resource_whitelist
|
| + deps = [
|
| + ":resource_whitelist",
|
| + ]
|
| + }
|
| +}
|
| +
|
| +# Generates a rule to repack a set of resources, substituting a given string
|
| +# in for the percentage (e.g. "100", "200"). It generates the repacked files in
|
| +# the "gen" directory, and then introduces a copy rule to copy it to the root
|
| +# build directory.
|
| +#
|
| +# It's not clear why this two-step dance is necessary as opposed to just
|
| +# generating the file in the destination. However, this is what the GYP build
|
| +# does, and for maintenance purposes, this keeps the same files in the same
|
| +# place between the two builds when possible.
|
| +#
|
| +# Argument:
|
| +# percent [required]
|
| +# String to substitute for the percentage.
|
| +template("chrome_repack_percent") {
|
| + percent = invoker.percent
|
| +
|
| + repack_name = "${target_name}_repack"
|
| + repack_output_file = "$root_gen_dir/repack/chrome_${percent}_percent.pak"
|
| +
|
| + copy_name = target_name
|
| +
|
| + repack(repack_name) {
|
| + visibility = [ ":$copy_name" ]
|
| +
|
| + # All sources should also have deps for completeness.
|
| + sources = [
|
| + "$root_gen_dir/blink/public/resources/blink_image_resources_${percent}_percent.pak",
|
| + "$root_gen_dir/chrome/renderer_resources_${percent}_percent.pak",
|
| + "$root_gen_dir/chrome/theme_resources_${percent}_percent.pak",
|
| + "$root_gen_dir/components/components_resources_${percent}_percent.pak",
|
| + "$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
|
| + "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
|
| + ]
|
| +
|
| + deps = [
|
| + "//chrome/app/theme:theme_resources",
|
| + "//chrome/renderer:resources",
|
| + "//components/resources",
|
| + "//components/strings",
|
| + "//content/app/resources",
|
| + "//net:net_resources",
|
| + "//third_party/WebKit/public:image_resources",
|
| + "//ui/resources",
|
| + ]
|
| +
|
| + if (use_ash) {
|
| + sources +=
|
| + [ "$root_gen_dir/ash/resources/ash_resources_${percent}_percent.pak" ]
|
| + deps += [ "//ash/resources" ]
|
| + }
|
| + if (toolkit_views) {
|
| + sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
|
| + deps += [ "//ui/views/resources" ]
|
| + }
|
| + if (is_chromeos) {
|
| + sources += [ "$root_gen_dir/ui/chromeos/resources/ui_chromeos_resources_${percent}_percent.pak" ]
|
| + deps += [ "//ui/chromeos/resources" ]
|
| + }
|
| + if (enable_extensions) {
|
| + sources += [ "$root_gen_dir/extensions/extensions_browser_resources_${percent}_percent.pak" ]
|
| + deps += [ "//extensions:extensions_browser_resources" ]
|
| + }
|
| + if (enable_app_list) {
|
| + sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${percent}_percent.pak" ]
|
| + deps += [ "//ui/app_list/resources" ]
|
| + }
|
| +
|
| + output = repack_output_file
|
| + copy_data_to_bundle = is_mac
|
| +
|
| + if (enable_resource_whitelist_generation) {
|
| + repack_whitelist = android_resource_whitelist
|
| + deps += [ ":resource_whitelist" ]
|
| + }
|
| + }
|
| +
|
| + copy(copy_name) {
|
| + visibility = [ ":*" ]
|
| + deps = [
|
| + ":$repack_name",
|
| + ]
|
| + sources = [
|
| + repack_output_file,
|
| + ]
|
| + outputs = [
|
| + "$root_build_dir/chrome_${percent}_percent.pak",
|
| + ]
|
| + }
|
| +}
|
| +
|
| +chrome_repack_percent("repack_chrome_100_percent") {
|
| + percent = "100"
|
| +}
|
| +
|
| +if (enable_hidpi) {
|
| + chrome_repack_percent("repack_chrome_200_percent") {
|
| + percent = "200"
|
| + }
|
| +}
|
| +
|
| # GYP version: chrome/chrome_resources.gyp:chrome_strings
|
| group("strings") {
|
| public_deps = [
|
| @@ -1479,9 +1660,6 @@
|
|
|
| if (enable_resource_whitelist_generation) {
|
| action("resource_whitelist") {
|
| - assert(is_android,
|
| - "Resource whitelist currently implemented only on Android")
|
| -
|
| deps = [
|
| "//chrome/android:chrome",
|
| ]
|
| @@ -1492,7 +1670,7 @@
|
| _infile,
|
| ]
|
|
|
| - _outfile = chrome_resource_whitelist
|
| + _outfile = android_resource_whitelist
|
| outputs = [
|
| _outfile,
|
| ]
|
|
|