1 import("//build/config/locales.gni")
2 import("//electron/buildflags/buildflags.gni")
3 import("//printing/buildflags/buildflags.gni")
4 import("//tools/grit/repack.gni")
5 import("//ui/base/ui_features.gni")
7 # See: //chrome/chrome_paks.gni
8 template("electron_repack_percent") {
9 percent = invoker.percent
12 forward_variables_from(invoker,
14 "copy_data_to_bundle",
19 # All sources should also have deps for completeness.
21 "$root_gen_dir/components/components_resources_${percent}_percent.pak",
22 "$root_gen_dir/third_party/blink/public/resources/blink_scaled_resources_${percent}_percent.pak",
23 "$root_gen_dir/ui/resources/ui_resources_${percent}_percent.pak",
27 "//components/resources",
28 "//third_party/blink/public:scaled_resources_${percent}_percent",
32 if (defined(invoker.deps)) {
37 sources += [ "$root_gen_dir/ui/views/resources/views_resources_${percent}_percent.pak" ]
38 deps += [ "//ui/views/resources" ]
41 output = "${invoker.output_dir}/chrome_${percent}_percent.pak"
45 template("electron_extra_paks") {
47 forward_variables_from(invoker,
49 "copy_data_to_bundle",
53 output = "${invoker.output_dir}/resources.pak"
55 "$root_gen_dir/chrome/browser_resources.pak",
56 "$root_gen_dir/chrome/common_resources.pak",
57 "$root_gen_dir/chrome/dev_ui_browser_resources.pak",
58 "$root_gen_dir/components/components_resources.pak",
59 "$root_gen_dir/content/browser/resources/media/media_internals_resources.pak",
60 "$root_gen_dir/content/browser/tracing/tracing_resources.pak",
61 "$root_gen_dir/content/browser/webrtc/resources/webrtc_internals_resources.pak",
62 "$root_gen_dir/content/content_resources.pak",
63 "$root_gen_dir/content/dev_ui_content_resources.pak",
64 "$root_gen_dir/mojo/public/js/mojo_bindings_resources.pak",
65 "$root_gen_dir/net/net_resources.pak",
66 "$root_gen_dir/third_party/blink/public/resources/blink_resources.pak",
67 "$root_gen_dir/third_party/blink/public/resources/inspector_overlay_resources.pak",
68 "$target_gen_dir/electron_resources.pak",
71 "//chrome/browser:dev_ui_browser_resources",
72 "//chrome/browser:resources",
73 "//chrome/common:resources",
74 "//components/resources",
75 "//content:content_resources",
76 "//content:dev_ui_content_resources",
77 "//content/browser/resources/media:resources",
78 "//content/browser/tracing:resources",
79 "//content/browser/webrtc/resources",
80 "//electron:resources",
81 "//mojo/public/js:resources",
82 "//net:net_resources",
83 "//third_party/blink/public:devtools_inspector_resources",
84 "//third_party/blink/public:resources",
87 if (defined(invoker.deps)) {
90 if (defined(invoker.additional_paks)) {
91 sources += invoker.additional_paks
94 # New paks should be added here by default.
96 "$root_gen_dir/content/browser/devtools/devtools_resources.pak",
97 "$root_gen_dir/ui/resources/webui_generated_resources.pak",
99 deps += [ "//content/browser/devtools:devtools_resources" ]
100 if (enable_pdf_viewer) {
101 sources += [ "$root_gen_dir/chrome/pdf_resources.pak" ]
102 deps += [ "//chrome/browser/resources/pdf:resources" ]
104 if (enable_print_preview) {
105 sources += [ "$root_gen_dir/chrome/print_preview_resources.pak" ]
106 deps += [ "//chrome/browser/resources/print_preview:resources" ]
108 if (enable_electron_extensions) {
110 "$root_gen_dir/chrome/component_extension_resources.pak",
111 "$root_gen_dir/extensions/extensions_renderer_resources.pak",
112 "$root_gen_dir/extensions/extensions_resources.pak",
115 "//chrome/browser/resources:component_extension_resources",
116 "//extensions:extensions_resources",
122 template("electron_paks") {
123 electron_repack_percent("${target_name}_100_percent") {
125 forward_variables_from(invoker,
127 "copy_data_to_bundle",
136 electron_repack_percent("${target_name}_200_percent") {
138 forward_variables_from(invoker,
140 "copy_data_to_bundle",
149 electron_extra_paks("${target_name}_extra") {
150 forward_variables_from(invoker,
152 "copy_data_to_bundle",
158 if (defined(invoker.additional_extra_paks)) {
159 additional_paks = invoker.additional_extra_paks
163 repack_locales("${target_name}_locales") {
164 forward_variables_from(invoker,
166 "copy_data_to_bundle",
170 if (defined(invoker.locale_whitelist)) {
171 repack_whitelist = invoker.locale_whitelist
172 } else if (defined(invoker.repack_whitelist)) {
173 repack_whitelist = invoker.repack_whitelist
177 "${root_gen_dir}/chrome/locale_settings_",
178 "${root_gen_dir}/chrome/platform_locale_settings_",
179 "${root_gen_dir}/chrome/generated_resources_",
180 "${root_gen_dir}/components/strings/components_locale_settings_",
181 "${root_gen_dir}/components/strings/components_strings_",
182 "${root_gen_dir}/device/bluetooth/strings/bluetooth_strings_",
183 "${root_gen_dir}/extensions/strings/extensions_strings_",
184 "${root_gen_dir}/services/strings/services_strings_",
185 "${root_gen_dir}/third_party/blink/public/strings/blink_accessibility_strings_",
186 "${root_gen_dir}/third_party/blink/public/strings/blink_strings_",
187 "${root_gen_dir}/ui/strings/app_locale_settings_",
188 "${root_gen_dir}/ui/strings/ax_strings_",
189 "${root_gen_dir}/ui/strings/ui_strings_",
192 "//chrome/app:generated_resources",
193 "//chrome/app/resources:locale_settings",
194 "//chrome/app/resources:platform_locale_settings",
195 "//components/strings:components_locale_settings",
196 "//components/strings:components_strings",
197 "//device/bluetooth/strings",
198 "//extensions/strings",
199 "//services/strings",
200 "//third_party/blink/public/strings",
201 "//third_party/blink/public/strings:accessibility_strings",
202 "//ui/strings:app_locale_settings",
203 "//ui/strings:ax_strings",
204 "//ui/strings:ui_strings",
207 input_locales = platform_pak_locales
208 output_dir = "${invoker.output_dir}/locales"
211 output_locales = locales_as_apple_outputs
213 output_locales = platform_pak_locales
218 forward_variables_from(invoker, [ "deps" ])
220 ":${target_name}_100_percent",
221 ":${target_name}_extra",
222 ":${target_name}_locales",
225 public_deps += [ ":${target_name}_200_percent" ]
227 if (defined(invoker.public_deps)) {
228 public_deps += invoker.public_deps