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

Side by Side Diff: components/strings/BUILD.gn

Issue 2003433003: [GN] Use build/config/locales.gni to simplify grit invocations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@locale
Patch Set: Fix "analyse" by adding a new variable locales_with_fake_bidi Created 4 years, 7 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 | « build/config/locales.gni ('k') | ios/chrome/app/strings/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 2014 The Chromium Authors. All rights reserved. 1 # Copyright 2014 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("//tools/grit/grit_rule.gni") 6 import("//tools/grit/grit_rule.gni")
6 7
7 if (is_android) { 8 if (is_android) {
8 import("//build/config/android/rules.gni") 9 import("//build/config/android/rules.gni")
9 android_components_strings_java_resources = [ 10 android_components_strings_java_resources = [
10 "java/res/values-am/components_strings.xml", 11 "java/res/values-am/components_strings.xml",
11 "java/res/values-ar/components_strings.xml", 12 "java/res/values-ar/components_strings.xml",
12 "java/res/values-bg/components_strings.xml", 13 "java/res/values-bg/components_strings.xml",
13 "java/res/values-ca/components_strings.xml", 14 "java/res/values-ca/components_strings.xml",
14 "java/res/values-cs/components_strings.xml", 15 "java/res/values-cs/components_strings.xml",
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 ":components_strings", 63 ":components_strings",
63 ] 64 ]
64 } 65 }
65 66
66 # GYP version: components/components_strings.gyp:components_strings 67 # GYP version: components/components_strings.gyp:components_strings
67 # (generate_components_strings action) 68 # (generate_components_strings action)
68 grit("components_strings") { 69 grit("components_strings") {
69 source = "../components_strings.grd" 70 source = "../components_strings.grd"
70 outputs = [ 71 outputs = [
71 "grit/components_strings.h", 72 "grit/components_strings.h",
72 "components_strings_am.pak",
73 "components_strings_ar.pak",
74 "components_strings_bg.pak",
75 "components_strings_bn.pak",
76 "components_strings_ca.pak",
77 "components_strings_cs.pak",
78 "components_strings_da.pak",
79 "components_strings_de.pak",
80 "components_strings_el.pak",
81 "components_strings_en-GB.pak",
82 "components_strings_en-US.pak",
83 "components_strings_es.pak",
84 "components_strings_es-419.pak",
85 "components_strings_et.pak",
86 "components_strings_fa.pak",
87 "components_strings_fake-bidi.pak",
88 "components_strings_fi.pak",
89 "components_strings_fil.pak",
90 "components_strings_fr.pak",
91 "components_strings_gu.pak",
92 "components_strings_he.pak",
93 "components_strings_hi.pak",
94 "components_strings_hr.pak",
95 "components_strings_hu.pak",
96 "components_strings_id.pak",
97 "components_strings_it.pak",
98 "components_strings_ja.pak",
99 "components_strings_kn.pak",
100 "components_strings_ko.pak",
101 "components_strings_lt.pak",
102 "components_strings_lv.pak",
103 "components_strings_ml.pak",
104 "components_strings_mr.pak",
105 "components_strings_ms.pak",
106 "components_strings_nl.pak",
107 "components_strings_nb.pak",
108 "components_strings_pl.pak",
109 "components_strings_pt-BR.pak",
110 "components_strings_pt-PT.pak",
111 "components_strings_ro.pak",
112 "components_strings_ru.pak",
113 "components_strings_sk.pak",
114 "components_strings_sl.pak",
115 "components_strings_sr.pak",
116 "components_strings_sv.pak",
117 "components_strings_sw.pak",
118 "components_strings_ta.pak",
119 "components_strings_te.pak",
120 "components_strings_th.pak",
121 "components_strings_tr.pak",
122 "components_strings_uk.pak",
123 "components_strings_vi.pak",
124 "components_strings_zh-CN.pak",
125 "components_strings_zh-TW.pak",
126 ] 73 ]
127 74 foreach(locale, locales_with_fake_bidi) {
128 if (is_ios) { 75 outputs += [ "components_strings_$locale.pak" ]
129 # iOS uses "pt" for pt-BR" and "es-MX" for "es-419".
130 outputs -= [
131 "components_strings_pt-BR.pak",
132 "components_strings_es-419.pak",
133 ]
134 outputs += [
135 "components_strings_pt.pak",
136 "components_strings_es-MX.pak",
137 ]
138 } 76 }
139 77
140 if (is_android) { 78 if (is_android) {
141 outputs += android_components_strings_java_resources 79 outputs += android_components_strings_java_resources
142 } 80 }
143 } 81 }
144 82
145 if (is_android) { 83 if (is_android) {
146 java_strings_grd_prebuilt("components_strings_grd") { 84 java_strings_grd_prebuilt("components_strings_grd") {
147 grit_output_dir = "$root_gen_dir/components/strings/java/res" 85 grit_output_dir = "$root_gen_dir/components/strings/java/res"
148 generated_files = 86 generated_files =
149 rebase_path(android_components_strings_java_resources, "java/res", ".") 87 rebase_path(android_components_strings_java_resources, "java/res", ".")
150 deps = [ 88 deps = [
151 ":components_strings", 89 ":components_strings",
152 ] 90 ]
153 } 91 }
154 } 92 }
155 93
156 # GYP version: components/components_strings.gyp:components_strings 94 # GYP version: components/components_strings.gyp:components_strings
157 # (generate_components_chromium_strings action) 95 # (generate_components_chromium_strings action)
158 grit("components_chromium_strings") { 96 grit("components_chromium_strings") {
159 source = "../components_chromium_strings.grd" 97 source = "../components_chromium_strings.grd"
160 outputs = [ 98 outputs = [
161 "grit/components_chromium_strings.h", 99 "grit/components_chromium_strings.h",
162 "components_chromium_strings_am.pak",
163 "components_chromium_strings_ar.pak",
164 "components_chromium_strings_bg.pak",
165 "components_chromium_strings_bn.pak",
166 "components_chromium_strings_ca.pak",
167 "components_chromium_strings_cs.pak",
168 "components_chromium_strings_da.pak",
169 "components_chromium_strings_de.pak",
170 "components_chromium_strings_el.pak",
171 "components_chromium_strings_en-GB.pak",
172 "components_chromium_strings_en-US.pak",
173 "components_chromium_strings_es.pak",
174 "components_chromium_strings_es-419.pak",
175 "components_chromium_strings_et.pak",
176 "components_chromium_strings_fa.pak",
177 "components_chromium_strings_fake-bidi.pak",
178 "components_chromium_strings_fi.pak",
179 "components_chromium_strings_fil.pak",
180 "components_chromium_strings_fr.pak",
181 "components_chromium_strings_gu.pak",
182 "components_chromium_strings_he.pak",
183 "components_chromium_strings_hi.pak",
184 "components_chromium_strings_hr.pak",
185 "components_chromium_strings_hu.pak",
186 "components_chromium_strings_id.pak",
187 "components_chromium_strings_it.pak",
188 "components_chromium_strings_ja.pak",
189 "components_chromium_strings_kn.pak",
190 "components_chromium_strings_ko.pak",
191 "components_chromium_strings_lt.pak",
192 "components_chromium_strings_lv.pak",
193 "components_chromium_strings_ml.pak",
194 "components_chromium_strings_mr.pak",
195 "components_chromium_strings_ms.pak",
196 "components_chromium_strings_nl.pak",
197 "components_chromium_strings_nb.pak",
198 "components_chromium_strings_pl.pak",
199 "components_chromium_strings_pt-BR.pak",
200 "components_chromium_strings_pt-PT.pak",
201 "components_chromium_strings_ro.pak",
202 "components_chromium_strings_ru.pak",
203 "components_chromium_strings_sk.pak",
204 "components_chromium_strings_sl.pak",
205 "components_chromium_strings_sr.pak",
206 "components_chromium_strings_sv.pak",
207 "components_chromium_strings_sw.pak",
208 "components_chromium_strings_ta.pak",
209 "components_chromium_strings_te.pak",
210 "components_chromium_strings_th.pak",
211 "components_chromium_strings_tr.pak",
212 "components_chromium_strings_uk.pak",
213 "components_chromium_strings_vi.pak",
214 "components_chromium_strings_zh-CN.pak",
215 "components_chromium_strings_zh-TW.pak",
216 ] 100 ]
217 101 foreach(locale, locales_with_fake_bidi) {
218 if (is_ios) { 102 outputs += [ "components_chromium_strings_$locale.pak" ]
219 # iOS uses "pt" for pt-BR" and "es-MX" for "es-419".
220 outputs -= [
221 "components_chromium_strings_pt-BR.pak",
222 "components_chromium_strings_es-419.pak",
223 ]
224 outputs += [
225 "components_chromium_strings_pt.pak",
226 "components_chromium_strings_es-MX.pak",
227 ]
228 } 103 }
229 } 104 }
230 105
231 # GYP version: components/components_strings.gyp:components_strings 106 # GYP version: components/components_strings.gyp:components_strings
232 # (generate_components_google_chrome_strings action) 107 # (generate_components_google_chrome_strings action)
233 grit("components_google_chrome_strings") { 108 grit("components_google_chrome_strings") {
234 source = "../components_google_chrome_strings.grd" 109 source = "../components_google_chrome_strings.grd"
235 outputs = [ 110 outputs = [
236 "grit/components_google_chrome_strings.h", 111 "grit/components_google_chrome_strings.h",
237 "components_google_chrome_strings_am.pak",
238 "components_google_chrome_strings_ar.pak",
239 "components_google_chrome_strings_bg.pak",
240 "components_google_chrome_strings_bn.pak",
241 "components_google_chrome_strings_ca.pak",
242 "components_google_chrome_strings_cs.pak",
243 "components_google_chrome_strings_da.pak",
244 "components_google_chrome_strings_de.pak",
245 "components_google_chrome_strings_el.pak",
246 "components_google_chrome_strings_en-GB.pak",
247 "components_google_chrome_strings_en-US.pak",
248 "components_google_chrome_strings_es.pak",
249 "components_google_chrome_strings_es-419.pak",
250 "components_google_chrome_strings_et.pak",
251 "components_google_chrome_strings_fa.pak",
252 "components_google_chrome_strings_fake-bidi.pak",
253 "components_google_chrome_strings_fi.pak",
254 "components_google_chrome_strings_fil.pak",
255 "components_google_chrome_strings_fr.pak",
256 "components_google_chrome_strings_gu.pak",
257 "components_google_chrome_strings_he.pak",
258 "components_google_chrome_strings_hi.pak",
259 "components_google_chrome_strings_hr.pak",
260 "components_google_chrome_strings_hu.pak",
261 "components_google_chrome_strings_id.pak",
262 "components_google_chrome_strings_it.pak",
263 "components_google_chrome_strings_ja.pak",
264 "components_google_chrome_strings_kn.pak",
265 "components_google_chrome_strings_ko.pak",
266 "components_google_chrome_strings_lt.pak",
267 "components_google_chrome_strings_lv.pak",
268 "components_google_chrome_strings_ml.pak",
269 "components_google_chrome_strings_mr.pak",
270 "components_google_chrome_strings_ms.pak",
271 "components_google_chrome_strings_nl.pak",
272 "components_google_chrome_strings_nb.pak",
273 "components_google_chrome_strings_pl.pak",
274 "components_google_chrome_strings_pt-BR.pak",
275 "components_google_chrome_strings_pt-PT.pak",
276 "components_google_chrome_strings_ro.pak",
277 "components_google_chrome_strings_ru.pak",
278 "components_google_chrome_strings_sk.pak",
279 "components_google_chrome_strings_sl.pak",
280 "components_google_chrome_strings_sr.pak",
281 "components_google_chrome_strings_sv.pak",
282 "components_google_chrome_strings_sw.pak",
283 "components_google_chrome_strings_ta.pak",
284 "components_google_chrome_strings_te.pak",
285 "components_google_chrome_strings_th.pak",
286 "components_google_chrome_strings_tr.pak",
287 "components_google_chrome_strings_uk.pak",
288 "components_google_chrome_strings_vi.pak",
289 "components_google_chrome_strings_zh-CN.pak",
290 "components_google_chrome_strings_zh-TW.pak",
291 ] 112 ]
292 113 foreach(locale, locales_with_fake_bidi) {
293 if (is_ios) { 114 outputs += [ "components_google_chrome_strings_$locale.pak" ]
294 # iOS uses "pt" for pt-BR" and "es-MX" for "es-419".
295 outputs -= [
296 "components_google_chrome_strings_pt-BR.pak",
297 "components_google_chrome_strings_es-419.pak",
298 ]
299 outputs += [
300 "components_google_chrome_strings_pt.pak",
301 "components_google_chrome_strings_es-MX.pak",
302 ]
303 } 115 }
304 } 116 }
305 117
306 # GYP version: components/components_strings.gyp:components_strings 118 # GYP version: components/components_strings.gyp:components_strings
307 # (generate_components_locale_settings action) 119 # (generate_components_locale_settings action)
308 grit("components_locale_settings") { 120 grit("components_locale_settings") {
309 source = "../components_locale_settings.grd" 121 source = "../components_locale_settings.grd"
310 outputs = [ 122 outputs = [
311 "grit/components_locale_settings.h", 123 "grit/components_locale_settings.h",
312 "components_locale_settings_am.pak",
313 "components_locale_settings_ar.pak",
314 "components_locale_settings_bg.pak",
315 "components_locale_settings_bn.pak",
316 "components_locale_settings_ca.pak",
317 "components_locale_settings_cs.pak",
318 "components_locale_settings_da.pak",
319 "components_locale_settings_de.pak",
320 "components_locale_settings_el.pak",
321 "components_locale_settings_en-GB.pak",
322 "components_locale_settings_en-US.pak",
323 "components_locale_settings_es.pak",
324 "components_locale_settings_es-419.pak",
325 "components_locale_settings_et.pak",
326 "components_locale_settings_fa.pak",
327 "components_locale_settings_fake-bidi.pak",
328 "components_locale_settings_fi.pak",
329 "components_locale_settings_fil.pak",
330 "components_locale_settings_fr.pak",
331 "components_locale_settings_gu.pak",
332 "components_locale_settings_he.pak",
333 "components_locale_settings_hi.pak",
334 "components_locale_settings_hr.pak",
335 "components_locale_settings_hu.pak",
336 "components_locale_settings_id.pak",
337 "components_locale_settings_it.pak",
338 "components_locale_settings_ja.pak",
339 "components_locale_settings_kn.pak",
340 "components_locale_settings_ko.pak",
341 "components_locale_settings_lt.pak",
342 "components_locale_settings_lv.pak",
343 "components_locale_settings_ml.pak",
344 "components_locale_settings_mr.pak",
345 "components_locale_settings_ms.pak",
346 "components_locale_settings_nl.pak",
347 "components_locale_settings_nb.pak",
348 "components_locale_settings_pl.pak",
349 "components_locale_settings_pt-BR.pak",
350 "components_locale_settings_pt-PT.pak",
351 "components_locale_settings_ro.pak",
352 "components_locale_settings_ru.pak",
353 "components_locale_settings_sk.pak",
354 "components_locale_settings_sl.pak",
355 "components_locale_settings_sr.pak",
356 "components_locale_settings_sv.pak",
357 "components_locale_settings_sw.pak",
358 "components_locale_settings_ta.pak",
359 "components_locale_settings_te.pak",
360 "components_locale_settings_th.pak",
361 "components_locale_settings_tr.pak",
362 "components_locale_settings_uk.pak",
363 "components_locale_settings_vi.pak",
364 "components_locale_settings_zh-CN.pak",
365 "components_locale_settings_zh-TW.pak",
366 ] 124 ]
367 125 foreach(locale, locales_with_fake_bidi) {
368 if (is_ios) { 126 outputs += [ "components_locale_settings_$locale.pak" ]
369 # iOS uses "pt" for pt-BR" and "es-MX" for "es-419".
370 outputs -= [
371 "components_locale_settings_pt-BR.pak",
372 "components_locale_settings_es-419.pak",
373 ]
374 outputs += [
375 "components_locale_settings_pt.pak",
376 "components_locale_settings_es-MX.pak",
377 ]
378 } 127 }
379 } 128 }
OLDNEW
« no previous file with comments | « build/config/locales.gni ('k') | ios/chrome/app/strings/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698