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

Side by Side Diff: chrome/chrome_paks.gni

Issue 2354803002: Create Monochrome-specific repack() targets (Closed)
Patch Set: fix arm64 Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/BUILD.gn ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright 2016 The Chromium Authors. All rights reserved. 1 # Copyright 2016 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 import("//build/config/locales.gni") 5 import("//build/config/locales.gni")
6 import("//ui/base/ui_features.gni")
6 import("chrome_repack_locales.gni") 7 import("chrome_repack_locales.gni")
7 8
8 # Generates a rule to repack a set of resources, substituting a given string 9 # Generates a rule to repack a set of resources, substituting a given string
9 # in for the percentage (e.g. "100", "200"). It generates the repacked files in 10 # in for the percentage (e.g. "100", "200"). It generates the repacked files in
10 # the "gen" directory, and then introduces a copy rule to copy it to the root 11 # the "gen" directory, and then introduces a copy rule to copy it to the root
11 # build directory. 12 # build directory.
12 # 13 #
13 # Argument: 14 # Argument:
14 # percent [required] 15 # percent [required]
15 # String to substitute for the percentage. 16 # String to substitute for the percentage.
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 } 69 }
69 if (enable_app_list) { 70 if (enable_app_list) {
70 sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${per cent}_percent.pak" ] 71 sources += [ "$root_gen_dir/ui/app_list/resources/app_list_resources_${per cent}_percent.pak" ]
71 deps += [ "//ui/app_list/resources" ] 72 deps += [ "//ui/app_list/resources" ]
72 } 73 }
73 74
74 output = "${invoker.output_dir}/chrome_${percent}_percent.pak" 75 output = "${invoker.output_dir}/chrome_${percent}_percent.pak"
75 } 76 }
76 } 77 }
77 78
78 # Paramters:
79 # output_dir:
80 #
81 template("chrome_paks") {
82 chrome_repack_percent("${target_name}_100_percent") {
83 percent = "100"
84 forward_variables_from(invoker,
85 [
86 "copy_data_to_bundle",
87 "deps",
88 "output_dir",
89 "repack_whitelist",
90 "visibility",
91 ])
92 }
93
94 if (invoker.enable_hidpi) {
95 chrome_repack_percent("${target_name}_200_percent") {
96 percent = "200"
97 forward_variables_from(invoker,
98 [
99 "copy_data_to_bundle",
100 "deps",
101 "output_dir",
102 "repack_whitelist",
103 "visibility",
104 ])
105 }
106 }
107
108 chrome_repack_locales("${target_name}_locales") {
109 forward_variables_from(invoker,
110 [
111 "copy_data_to_bundle",
112 "deps",
113 "repack_whitelist",
114 "visibility",
115 ])
116
117 input_locales = locales
118 output_dir = "${invoker.output_dir}/locales"
119
120 if (is_mac) {
121 output_locales = locales_as_mac_outputs
122 } else {
123 output_locales = locales
124 }
125 }
126
127 group(target_name) {
128 forward_variables_from(invoker, [ "deps" ])
129 public_deps = [
130 ":${target_name}_100_percent",
131 ":${target_name}_locales",
132 ]
133 if (invoker.enable_hidpi) {
134 public_deps += [ ":${target_name}_200_percent" ]
135 }
136 if (defined(invoker.public_deps)) {
137 public_deps += invoker.public_deps
138 }
139 }
140 }
141
142 template("chrome_extra_paks") { 79 template("chrome_extra_paks") {
143 repack(target_name) { 80 repack(target_name) {
144 forward_variables_from(invoker, 81 forward_variables_from(invoker,
145 [ 82 [
146 "copy_data_to_bundle", 83 "copy_data_to_bundle",
147 "repack_whitelist", 84 "repack_whitelist",
148 "visibility", 85 "visibility",
149 ]) 86 ])
150 output = "${invoker.output_dir}/resources.pak" 87 output = "${invoker.output_dir}/resources.pak"
151 sources = [ 88 sources = [
(...skipping 24 matching lines...) Expand all
176 "//components/resources", 113 "//components/resources",
177 "//content:resources", 114 "//content:resources",
178 "//content/browser/tracing:resources", 115 "//content/browser/tracing:resources",
179 "//net:net_resources", 116 "//net:net_resources",
180 "//third_party/WebKit/public:resources", 117 "//third_party/WebKit/public:resources",
181 "//ui/resources", 118 "//ui/resources",
182 ] 119 ]
183 if (defined(invoker.deps)) { 120 if (defined(invoker.deps)) {
184 deps += invoker.deps 121 deps += invoker.deps
185 } 122 }
123 if (defined(invoker.additional_paks)) {
124 sources += invoker.additional_paks
125 }
186 126
187 if (is_android) { 127 if (!is_android) {
188 sources += [ "$root_gen_dir/android_webview/aw_resources.pak" ]
189 deps += [ "//android_webview:generate_aw_resources" ]
190 } else { # Non-Android.
191 # New paks should be added here by default. 128 # New paks should be added here by default.
192 sources += [ 129 sources += [
193 "$root_gen_dir/blink/devtools_resources.pak", 130 "$root_gen_dir/blink/devtools_resources.pak",
194 "$root_gen_dir/chrome/component_extension_resources.pak", 131 "$root_gen_dir/chrome/component_extension_resources.pak",
195 "$root_gen_dir/chrome/options_resources.pak", 132 "$root_gen_dir/chrome/options_resources.pak",
196 "$root_gen_dir/chrome/quota_internals_resources.pak", 133 "$root_gen_dir/chrome/quota_internals_resources.pak",
197 "$root_gen_dir/chrome/settings_resources.pak", 134 "$root_gen_dir/chrome/settings_resources.pak",
198 "$root_gen_dir/chrome/sync_file_system_internals_resources.pak", 135 "$root_gen_dir/chrome/sync_file_system_internals_resources.pak",
199 ] 136 ]
200 deps += [ 137 deps += [
(...skipping 11 matching lines...) Expand all
212 } 149 }
213 if (enable_extensions) { 150 if (enable_extensions) {
214 sources += [ 151 sources += [
215 "$root_gen_dir/extensions/extensions_renderer_resources.pak", 152 "$root_gen_dir/extensions/extensions_renderer_resources.pak",
216 "$root_gen_dir/extensions/extensions_resources.pak", 153 "$root_gen_dir/extensions/extensions_resources.pak",
217 ] 154 ]
218 deps += [ "//extensions:extensions_resources" ] 155 deps += [ "//extensions:extensions_resources" ]
219 } 156 }
220 } 157 }
221 } 158 }
159
160 # Defines repack() targets used by Chrome. Specifically:
161 # * chrome_100_percent.pak
162 # * chrome_200_percent.pak (optionally)
163 # * resources.pak
164 # * locale .pak files
165 #
166 # Paramters:
167 # output_dir [required]: Directory to output .pak files. Locale .pak files
168 # will always be place in $output_dir/locales
169 # additional_extra_paks: List of extra .pak sources for resources.pak.
170 # copy_data_to_bundle:
171 # deps:
172 # output_dir:
173 # public_deps:
174 # repack_whitelist:
175 # visibility:
176 # Normal meanings.
177 #
178 template("chrome_paks") {
179 chrome_repack_percent("${target_name}_100_percent") {
180 percent = "100"
181 forward_variables_from(invoker,
182 [
183 "copy_data_to_bundle",
184 "deps",
185 "output_dir",
186 "repack_whitelist",
187 "visibility",
188 ])
189 }
190
191 if (enable_hidpi) {
192 chrome_repack_percent("${target_name}_200_percent") {
193 percent = "200"
194 forward_variables_from(invoker,
195 [
196 "copy_data_to_bundle",
197 "deps",
198 "output_dir",
199 "repack_whitelist",
200 "visibility",
201 ])
202 }
203 }
204
205 chrome_extra_paks("${target_name}_extra") {
206 forward_variables_from(invoker,
207 [
208 "copy_data_to_bundle",
209 "deps",
210 "output_dir",
211 "repack_whitelist",
212 "visibility",
213 ])
214 if (defined(invoker.additional_extra_paks)) {
215 additional_paks = invoker.additional_extra_paks
216 }
217 }
218
219 chrome_repack_locales("${target_name}_locales") {
220 forward_variables_from(invoker,
221 [
222 "copy_data_to_bundle",
223 "deps",
224 "repack_whitelist",
225 "visibility",
226 ])
227
228 input_locales = locales
229 output_dir = "${invoker.output_dir}/locales"
230
231 if (is_mac) {
232 output_locales = locales_as_mac_outputs
233 } else {
234 output_locales = locales
235 }
236 }
237
238 group(target_name) {
239 forward_variables_from(invoker, [ "deps" ])
240 public_deps = [
241 ":${target_name}_100_percent",
242 ":${target_name}_extra",
243 ":${target_name}_locales",
244 ]
245 if (enable_hidpi) {
246 public_deps += [ ":${target_name}_200_percent" ]
247 }
248 if (defined(invoker.public_deps)) {
249 public_deps += invoker.public_deps
250 }
251 }
252 }
OLDNEW
« no previous file with comments | « chrome/browser/resources/chromeos/chromevox/BUILD.gn ('k') | chrome/test/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698