2018-07-18 01:34:19 +03:00
|
|
|
import("//build/config/locales.gni")
|
2020-01-14 01:55:58 +03:00
|
|
|
import("//electron/buildflags/buildflags.gni")
|
2018-08-01 00:47:36 +03:00
|
|
|
import("//printing/buildflags/buildflags.gni")
|
2018-07-18 01:34:19 +03:00
|
|
|
import("//tools/grit/repack.gni")
|
|
|
|
import("//ui/base/ui_features.gni")
|
|
|
|
|
|
|
|
# See: //chrome/chrome_paks.gni
|
|
|
|
template("electron_repack_percent") {
|
|
|
|
percent = invoker.percent
|
|
|
|
|
|
|
|
repack(target_name) {
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"copy_data_to_bundle",
|
|
|
|
"repack_whitelist",
|
|
|
|
"visibility",
|
|
|
|
])
|
|
|
|
|
|
|
|
# All sources should also have deps for completeness.
|
|
|
|
sources = [
|
|
|
|
"$root_gen_dir/components/components_resources_${percent}_percent.pak",
|
|
|
|
"$root_gen_dir/content/app/resources/content_resources_${percent}_percent.pak",
|
2018-10-04 02:03:26 +03:00
|
|
|
"$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_${percent}_percent.pak",
|
2018-07-18 01:34:19 +03:00
|
|
|
"$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
|
|
|
|
]
|
|
|
|
|
|
|
|
deps = [
|
|
|
|
"//components/resources",
|
|
|
|
"//content/app/resources",
|
2018-07-20 19:08:18 +03:00
|
|
|
"//third_party/blink/public:scaled_resources_${percent}_percent",
|
2018-07-18 01:34:19 +03:00
|
|
|
"//ui/resources",
|
|
|
|
]
|
|
|
|
|
|
|
|
if (defined(invoker.deps)) {
|
|
|
|
deps += invoker.deps
|
|
|
|
}
|
|
|
|
|
|
|
|
if (toolkit_views) {
|
|
|
|
sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
|
|
|
|
deps += [ "//ui/views/resources" ]
|
|
|
|
}
|
|
|
|
|
|
|
|
output = "${invoker.output_dir}/chrome_${percent}_percent.pak"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template("electron_extra_paks") {
|
|
|
|
repack(target_name) {
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"copy_data_to_bundle",
|
|
|
|
"repack_whitelist",
|
|
|
|
"visibility",
|
|
|
|
])
|
|
|
|
output = "${invoker.output_dir}/resources.pak"
|
|
|
|
sources = [
|
2022-04-06 19:34:35 +03:00
|
|
|
"$root_gen_dir/chrome/browser_resources.pak",
|
|
|
|
"$root_gen_dir/chrome/common_resources.pak",
|
2020-07-16 20:14:54 +03:00
|
|
|
"$root_gen_dir/chrome/dev_ui_browser_resources.pak",
|
2018-07-18 01:34:19 +03:00
|
|
|
"$root_gen_dir/components/components_resources.pak",
|
2020-06-11 05:07:49 +03:00
|
|
|
"$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
|
2018-07-18 01:34:19 +03:00
|
|
|
"$root_gen_dir/content/browser/tracing/tracing_resources.pak",
|
2020-06-11 05:07:49 +03:00
|
|
|
"$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
|
2018-07-18 01:34:19 +03:00
|
|
|
"$root_gen_dir/content/content_resources.pak",
|
2020-01-21 20:39:37 +03:00
|
|
|
"$root_gen_dir/content/dev_ui_content_resources.pak",
|
2018-07-18 01:34:19 +03:00
|
|
|
"$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
|
|
|
|
"$root_gen_dir/net/net_resources.pak",
|
2018-10-04 02:03:26 +03:00
|
|
|
"$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
|
2020-08-11 02:54:05 +03:00
|
|
|
"$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
|
2018-12-11 20:07:32 +03:00
|
|
|
"$root_gen_dir/ui/resources/webui_resources.pak",
|
2018-10-04 21:08:56 +03:00
|
|
|
"$target_gen_dir/electron_resources.pak",
|
2018-07-18 01:34:19 +03:00
|
|
|
]
|
|
|
|
deps = [
|
2020-07-16 20:14:54 +03:00
|
|
|
"//chrome/browser:dev_ui_browser_resources",
|
2022-04-06 19:34:35 +03:00
|
|
|
"//chrome/browser:resources",
|
|
|
|
"//chrome/common:resources",
|
2018-07-18 01:34:19 +03:00
|
|
|
"//components/resources",
|
2020-01-21 20:39:37 +03:00
|
|
|
"//content:content_resources",
|
|
|
|
"//content:dev_ui_content_resources",
|
2021-03-05 02:53:46 +03:00
|
|
|
"//content/browser/resources/media:resources",
|
2018-07-18 01:34:19 +03:00
|
|
|
"//content/browser/tracing:resources",
|
2020-06-11 05:07:49 +03:00
|
|
|
"//content/browser/webrtc/resources",
|
2018-10-04 21:08:56 +03:00
|
|
|
"//electron:resources",
|
2018-07-18 01:34:19 +03:00
|
|
|
"//mojo/public/js:resources",
|
|
|
|
"//net:net_resources",
|
2020-08-11 02:54:05 +03:00
|
|
|
"//third_party/blink/public:devtools_inspector_resources",
|
2018-07-20 19:08:18 +03:00
|
|
|
"//third_party/blink/public:resources",
|
2018-12-11 20:07:32 +03:00
|
|
|
"//ui/resources",
|
2018-07-18 01:34:19 +03:00
|
|
|
]
|
|
|
|
if (defined(invoker.deps)) {
|
|
|
|
deps += invoker.deps
|
|
|
|
}
|
|
|
|
if (defined(invoker.additional_paks)) {
|
|
|
|
sources += invoker.additional_paks
|
|
|
|
}
|
|
|
|
|
|
|
|
# New paks should be added here by default.
|
2021-01-08 09:17:28 +03:00
|
|
|
sources += [
|
|
|
|
"$root_gen_dir/content/browser/devtools/devtools_resources.pak",
|
|
|
|
"$root_gen_dir/ui/resources/webui_generated_resources.pak",
|
|
|
|
]
|
2018-07-18 01:34:19 +03:00
|
|
|
deps += [ "//content/browser/devtools:devtools_resources" ]
|
2021-01-28 04:09:55 +03:00
|
|
|
if (enable_pdf_viewer) {
|
|
|
|
sources += [ "$root_gen_dir/chrome/pdf_resources.pak" ]
|
2021-02-09 23:16:21 +03:00
|
|
|
deps += [ "//chrome/browser/resources/pdf:resources" ]
|
2021-01-28 04:09:55 +03:00
|
|
|
}
|
2018-07-18 01:34:19 +03:00
|
|
|
if (enable_print_preview) {
|
|
|
|
sources += [ "$root_gen_dir/chrome/print_preview_resources.pak" ]
|
2021-02-09 23:16:21 +03:00
|
|
|
deps += [ "//chrome/browser/resources/print_preview:resources" ]
|
2018-07-18 01:34:19 +03:00
|
|
|
}
|
2020-01-14 01:55:58 +03:00
|
|
|
if (enable_electron_extensions) {
|
|
|
|
sources += [
|
2020-02-13 03:39:12 +03:00
|
|
|
"$root_gen_dir/chrome/component_extension_resources.pak",
|
2020-01-14 01:55:58 +03:00
|
|
|
"$root_gen_dir/extensions/extensions_renderer_resources.pak",
|
|
|
|
"$root_gen_dir/extensions/extensions_resources.pak",
|
|
|
|
]
|
2020-02-13 03:39:12 +03:00
|
|
|
deps += [
|
|
|
|
"//chrome/browser/resources:component_extension_resources",
|
|
|
|
"//extensions:extensions_resources",
|
|
|
|
]
|
2020-01-14 01:55:58 +03:00
|
|
|
}
|
2018-07-18 01:34:19 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
template("electron_paks") {
|
|
|
|
electron_repack_percent("${target_name}_100_percent") {
|
|
|
|
percent = "100"
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"copy_data_to_bundle",
|
|
|
|
"deps",
|
|
|
|
"output_dir",
|
|
|
|
"repack_whitelist",
|
|
|
|
"visibility",
|
|
|
|
])
|
|
|
|
}
|
|
|
|
|
|
|
|
if (enable_hidpi) {
|
|
|
|
electron_repack_percent("${target_name}_200_percent") {
|
|
|
|
percent = "200"
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"copy_data_to_bundle",
|
|
|
|
"deps",
|
|
|
|
"output_dir",
|
|
|
|
"repack_whitelist",
|
|
|
|
"visibility",
|
|
|
|
])
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
electron_extra_paks("${target_name}_extra") {
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"copy_data_to_bundle",
|
|
|
|
"deps",
|
|
|
|
"output_dir",
|
|
|
|
"repack_whitelist",
|
|
|
|
"visibility",
|
|
|
|
])
|
|
|
|
if (defined(invoker.additional_extra_paks)) {
|
|
|
|
additional_paks = invoker.additional_extra_paks
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
repack_locales("${target_name}_locales") {
|
|
|
|
forward_variables_from(invoker,
|
|
|
|
[
|
|
|
|
"copy_data_to_bundle",
|
|
|
|
"deps",
|
|
|
|
"visibility",
|
|
|
|
])
|
|
|
|
if (defined(invoker.locale_whitelist)) {
|
|
|
|
repack_whitelist = invoker.locale_whitelist
|
|
|
|
} else if (defined(invoker.repack_whitelist)) {
|
|
|
|
repack_whitelist = invoker.repack_whitelist
|
|
|
|
}
|
|
|
|
|
2018-07-27 18:05:36 +03:00
|
|
|
source_patterns = [
|
2022-04-06 19:34:35 +03:00
|
|
|
"${root_gen_dir}/chrome/locale_settings_",
|
2018-11-08 17:51:51 +03:00
|
|
|
"${root_gen_dir}/chrome/platform_locale_settings_",
|
2022-04-06 19:34:35 +03:00
|
|
|
"${root_gen_dir}/chrome/generated_resources_",
|
|
|
|
"${root_gen_dir}/components/strings/components_locale_settings_",
|
2018-09-12 16:45:08 +03:00
|
|
|
"${root_gen_dir}/components/strings/components_strings_",
|
2019-06-04 06:44:12 +03:00
|
|
|
"${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
|
|
|
|
"${root_gen_dir}/services/strings/services_strings_",
|
2022-04-06 19:34:35 +03:00
|
|
|
"${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
|
2018-07-30 21:36:43 +03:00
|
|
|
"${root_gen_dir}/ui/strings/app_locale_settings_",
|
2022-01-21 21:04:06 +03:00
|
|
|
"${root_gen_dir}/ui/strings/ax_strings_",
|
2018-07-27 18:05:36 +03:00
|
|
|
"${root_gen_dir}/ui/strings/ui_strings_",
|
|
|
|
]
|
2018-07-18 01:34:19 +03:00
|
|
|
deps = [
|
2022-04-06 19:34:35 +03:00
|
|
|
"//chrome/app:generated_resources",
|
|
|
|
"//chrome/app/resources:locale_settings",
|
2018-11-08 17:51:51 +03:00
|
|
|
"//chrome/app/resources:platform_locale_settings",
|
2022-04-06 19:34:35 +03:00
|
|
|
"//components/strings:components_locale_settings",
|
2018-09-12 16:45:08 +03:00
|
|
|
"//components/strings:components_strings",
|
2018-11-28 19:36:00 +03:00
|
|
|
"//device/bluetooth/strings",
|
2019-06-04 06:44:12 +03:00
|
|
|
"//services/strings",
|
2019-09-21 17:51:28 +03:00
|
|
|
"//third_party/blink/public/strings",
|
2018-07-30 21:36:43 +03:00
|
|
|
"//ui/strings:app_locale_settings",
|
2022-01-21 21:04:06 +03:00
|
|
|
"//ui/strings:ax_strings",
|
2018-07-27 18:05:36 +03:00
|
|
|
"//ui/strings:ui_strings",
|
2018-07-18 01:34:19 +03:00
|
|
|
]
|
|
|
|
|
2022-02-25 21:17:35 +03:00
|
|
|
input_locales = platform_pak_locales
|
2018-07-18 01:34:19 +03:00
|
|
|
output_dir = "${invoker.output_dir}/locales"
|
|
|
|
|
|
|
|
if (is_mac) {
|
2022-03-25 04:39:03 +03:00
|
|
|
output_locales = locales_as_apple_outputs
|
2018-07-18 01:34:19 +03:00
|
|
|
} else {
|
2022-02-25 21:17:35 +03:00
|
|
|
output_locales = platform_pak_locales
|
2018-07-18 01:34:19 +03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
group(target_name) {
|
|
|
|
forward_variables_from(invoker, [ "deps" ])
|
|
|
|
public_deps = [
|
|
|
|
":${target_name}_100_percent",
|
|
|
|
":${target_name}_extra",
|
|
|
|
":${target_name}_locales",
|
|
|
|
]
|
|
|
|
if (enable_hidpi) {
|
|
|
|
public_deps += [ ":${target_name}_200_percent" ]
|
|
|
|
}
|
|
|
|
if (defined(invoker.public_deps)) {
|
|
|
|
public_deps += invoker.public_deps
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|