gn format //chrome
[chromium-blink-merge.git] / chrome / app / BUILD.gn
blobcae879864e3035ed1883ce87562037e6321cac92
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
3 # found in the LICENSE file.
5 import("//tools/grit/grit_rule.gni")
7 if (is_android) {
8   import("//build/config/android/rules.gni")
9   android_generated_java_resources = [
10     "java/res/values-am/generated_resources.xml",
11     "java/res/values-ar/generated_resources.xml",
12     "java/res/values-bg/generated_resources.xml",
13     "java/res/values-ca/generated_resources.xml",
14     "java/res/values-cs/generated_resources.xml",
15     "java/res/values-da/generated_resources.xml",
16     "java/res/values-de/generated_resources.xml",
17     "java/res/values-el/generated_resources.xml",
18     "java/res/values-en-rGB/generated_resources.xml",
19     "java/res/values-es-rUS/generated_resources.xml",
20     "java/res/values-es/generated_resources.xml",
21     "java/res/values-fa/generated_resources.xml",
22     "java/res/values-fi/generated_resources.xml",
23     "java/res/values-fr/generated_resources.xml",
24     "java/res/values-hi/generated_resources.xml",
25     "java/res/values-hr/generated_resources.xml",
26     "java/res/values-hu/generated_resources.xml",
27     "java/res/values-in/generated_resources.xml",
28     "java/res/values-it/generated_resources.xml",
29     "java/res/values-iw/generated_resources.xml",
30     "java/res/values-ja/generated_resources.xml",
31     "java/res/values-ko/generated_resources.xml",
32     "java/res/values-lt/generated_resources.xml",
33     "java/res/values-lv/generated_resources.xml",
34     "java/res/values-nb/generated_resources.xml",
35     "java/res/values-nl/generated_resources.xml",
36     "java/res/values-pl/generated_resources.xml",
37     "java/res/values-pt-rBR/generated_resources.xml",
38     "java/res/values-pt-rPT/generated_resources.xml",
39     "java/res/values-ro/generated_resources.xml",
40     "java/res/values-ru/generated_resources.xml",
41     "java/res/values-sk/generated_resources.xml",
42     "java/res/values-sl/generated_resources.xml",
43     "java/res/values-sr/generated_resources.xml",
44     "java/res/values-sv/generated_resources.xml",
45     "java/res/values-sw/generated_resources.xml",
46     "java/res/values-th/generated_resources.xml",
47     "java/res/values-tl/generated_resources.xml",
48     "java/res/values-tr/generated_resources.xml",
49     "java/res/values-uk/generated_resources.xml",
50     "java/res/values-vi/generated_resources.xml",
51     "java/res/values-zh-rCN/generated_resources.xml",
52     "java/res/values-zh-rTW/generated_resources.xml",
53     "java/res/values/generated_resources.xml",
54   ]
57 # GYP version: chrome/chrome_resources.gyp:chrome_strings
58 #              (generate_generated_resources action)
59 grit("generated_resources") {
60   source = "generated_resources.grd"
61   output_dir = "$root_gen_dir/chrome"
62   use_qualified_include = true
63   outputs = [
64     "grit/generated_resources.h",
65     "generated_resources_am.pak",
66     "generated_resources_ar.pak",
67     "generated_resources_bg.pak",
68     "generated_resources_bn.pak",
69     "generated_resources_ca.pak",
70     "generated_resources_cs.pak",
71     "generated_resources_da.pak",
72     "generated_resources_de.pak",
73     "generated_resources_el.pak",
74     "generated_resources_en-GB.pak",
75     "generated_resources_en-US.pak",
76     "generated_resources_es.pak",
77     "generated_resources_es-419.pak",
78     "generated_resources_et.pak",
79     "generated_resources_fa.pak",
80     "generated_resources_fake-bidi.pak",
81     "generated_resources_fi.pak",
82     "generated_resources_fil.pak",
83     "generated_resources_fr.pak",
84     "generated_resources_gu.pak",
85     "generated_resources_he.pak",
86     "generated_resources_hi.pak",
87     "generated_resources_hr.pak",
88     "generated_resources_hu.pak",
89     "generated_resources_id.pak",
90     "generated_resources_it.pak",
91     "generated_resources_ja.pak",
92     "generated_resources_kn.pak",
93     "generated_resources_ko.pak",
94     "generated_resources_lt.pak",
95     "generated_resources_lv.pak",
96     "generated_resources_ml.pak",
97     "generated_resources_mr.pak",
98     "generated_resources_ms.pak",
99     "generated_resources_nl.pak",
100     "generated_resources_nb.pak",
101     "generated_resources_pl.pak",
102     "generated_resources_pt-BR.pak",
103     "generated_resources_pt-PT.pak",
104     "generated_resources_ro.pak",
105     "generated_resources_ru.pak",
106     "generated_resources_sk.pak",
107     "generated_resources_sl.pak",
108     "generated_resources_sr.pak",
109     "generated_resources_sv.pak",
110     "generated_resources_sw.pak",
111     "generated_resources_ta.pak",
112     "generated_resources_te.pak",
113     "generated_resources_th.pak",
114     "generated_resources_tr.pak",
115     "generated_resources_uk.pak",
116     "generated_resources_vi.pak",
117     "generated_resources_zh-CN.pak",
118     "generated_resources_zh-TW.pak",
119   ]
121   if (is_android) {
122     outputs += android_generated_java_resources
123   }
126 if (is_android) {
127   java_strings_grd_prebuilt("java_strings_grd") {
128     grit_output_dir = "$root_gen_dir/chrome/java/res"
129     generated_files =
130         rebase_path(android_generated_java_resources, "java/res", ".")
131   }
134 # GYP version: chrome/chrome_resources.gyp:chrome_strings_map
135 action("make_generated_resources_map") {
136   # Targets should depend on generated_resources_map instead.
137   visibility = [ ":generated_resources_map" ]
139   script = "//chrome/browser/metrics/variations/generate_resources_map.py"
141   inputs = [
142     "$root_gen_dir/chrome/grit/generated_resources.h",
143   ]
144   outputs = [
145     "$root_gen_dir/chrome/generated_resources_map.cc",
146   ]
148   args =
149       rebase_path(inputs, root_build_dir) + rebase_path(outputs, root_build_dir)
151   deps = [
152     ":generated_resources",
153   ]
156 # Collect the generated .cc file from make_generated_resources_map and put it
157 # in a source set so targets that depend on it will link the source rather than
158 # specifying it manually. This doesn't happen in the GYP build.
159 source_set("generated_resources_map") {
160   sources = get_target_outputs(":make_generated_resources_map")
163 # GYP version: chrome/chrome_resources.gyp:chrome_strings
164 #              (generate_google_chrome_strings action)
165 grit("google_chrome_strings") {
166   source = "google_chrome_strings.grd"
167   output_dir = "$root_gen_dir/chrome"
168   use_qualified_include = true
169   outputs = [
170     "grit/google_chrome_strings.h",
171     "google_chrome_strings_am.pak",
172     "google_chrome_strings_ar.pak",
173     "google_chrome_strings_bg.pak",
174     "google_chrome_strings_bn.pak",
175     "google_chrome_strings_ca.pak",
176     "google_chrome_strings_cs.pak",
177     "google_chrome_strings_da.pak",
178     "google_chrome_strings_de.pak",
179     "google_chrome_strings_el.pak",
180     "google_chrome_strings_en-GB.pak",
181     "google_chrome_strings_en-US.pak",
182     "google_chrome_strings_es.pak",
183     "google_chrome_strings_es-419.pak",
184     "google_chrome_strings_et.pak",
185     "google_chrome_strings_fa.pak",
186     "google_chrome_strings_fi.pak",
187     "google_chrome_strings_fil.pak",
188     "google_chrome_strings_fr.pak",
189     "google_chrome_strings_gu.pak",
190     "google_chrome_strings_he.pak",
191     "google_chrome_strings_hi.pak",
192     "google_chrome_strings_hr.pak",
193     "google_chrome_strings_hu.pak",
194     "google_chrome_strings_id.pak",
195     "google_chrome_strings_it.pak",
196     "google_chrome_strings_ja.pak",
197     "google_chrome_strings_kn.pak",
198     "google_chrome_strings_ko.pak",
199     "google_chrome_strings_lt.pak",
200     "google_chrome_strings_lv.pak",
201     "google_chrome_strings_ml.pak",
202     "google_chrome_strings_mr.pak",
203     "google_chrome_strings_ms.pak",
204     "google_chrome_strings_nl.pak",
205     "google_chrome_strings_nb.pak",
206     "google_chrome_strings_pl.pak",
207     "google_chrome_strings_pt-BR.pak",
208     "google_chrome_strings_pt-PT.pak",
209     "google_chrome_strings_ro.pak",
210     "google_chrome_strings_ru.pak",
211     "google_chrome_strings_sk.pak",
212     "google_chrome_strings_sl.pak",
213     "google_chrome_strings_sr.pak",
214     "google_chrome_strings_sv.pak",
215     "google_chrome_strings_sw.pak",
216     "google_chrome_strings_ta.pak",
217     "google_chrome_strings_te.pak",
218     "google_chrome_strings_th.pak",
219     "google_chrome_strings_tr.pak",
220     "google_chrome_strings_uk.pak",
221     "google_chrome_strings_vi.pak",
222     "google_chrome_strings_zh-CN.pak",
223     "google_chrome_strings_zh-TW.pak",
224     "google_chrome_strings_fake-bidi.pak",
225   ]
228 # GYP version: chrome/chrome_resources.gyp:chrome_strings
229 #              (generate_chromium_strings action)
230 grit("chromium_strings") {
231   source = "chromium_strings.grd"
232   output_dir = "$root_gen_dir/chrome"
233   use_qualified_include = true
234   outputs = [
235     "grit/chromium_strings.h",
236     "chromium_strings_am.pak",
237     "chromium_strings_ar.pak",
238     "chromium_strings_bg.pak",
239     "chromium_strings_bn.pak",
240     "chromium_strings_ca.pak",
241     "chromium_strings_cs.pak",
242     "chromium_strings_da.pak",
243     "chromium_strings_de.pak",
244     "chromium_strings_el.pak",
245     "chromium_strings_en-GB.pak",
246     "chromium_strings_en-US.pak",
247     "chromium_strings_es.pak",
248     "chromium_strings_es-419.pak",
249     "chromium_strings_et.pak",
250     "chromium_strings_fa.pak",
251     "chromium_strings_fake-bidi.pak",
252     "chromium_strings_fi.pak",
253     "chromium_strings_fil.pak",
254     "chromium_strings_fr.pak",
255     "chromium_strings_gu.pak",
256     "chromium_strings_he.pak",
257     "chromium_strings_hi.pak",
258     "chromium_strings_hr.pak",
259     "chromium_strings_hu.pak",
260     "chromium_strings_id.pak",
261     "chromium_strings_it.pak",
262     "chromium_strings_ja.pak",
263     "chromium_strings_kn.pak",
264     "chromium_strings_ko.pak",
265     "chromium_strings_lt.pak",
266     "chromium_strings_lv.pak",
267     "chromium_strings_ml.pak",
268     "chromium_strings_mr.pak",
269     "chromium_strings_ms.pak",
270     "chromium_strings_nl.pak",
271     "chromium_strings_nb.pak",
272     "chromium_strings_pl.pak",
273     "chromium_strings_pt-BR.pak",
274     "chromium_strings_pt-PT.pak",
275     "chromium_strings_ro.pak",
276     "chromium_strings_ru.pak",
277     "chromium_strings_sk.pak",
278     "chromium_strings_sl.pak",
279     "chromium_strings_sr.pak",
280     "chromium_strings_sv.pak",
281     "chromium_strings_sw.pak",
282     "chromium_strings_ta.pak",
283     "chromium_strings_te.pak",
284     "chromium_strings_th.pak",
285     "chromium_strings_tr.pak",
286     "chromium_strings_uk.pak",
287     "chromium_strings_vi.pak",
288     "chromium_strings_zh-CN.pak",
289     "chromium_strings_zh-TW.pak",
290   ]
293 source_set("test_support") {
294   testonly = true
295   visibility = [ "//chrome/test:test_support" ]
297   sources = [
298     "chrome_main_delegate.cc",
299     "chrome_main_delegate.h",
300     "close_handle_hook_win.cc",
301     "close_handle_hook_win.h",
302   ]
304   deps = [
305     "//base",
306     "//chrome/browser",
307     "//chrome/common",
308     "//chrome/plugin",
309     "//chrome/renderer",
310     "//chrome/utility",
311     "//content/public/app:both",
312     "//content/public/common",
313     "//ui/base",
314   ]
316   if (is_mac) {
317     sources += [
318       "chrome_breakpad_client.cc",
319       "chrome_breakpad_client_mac.mm",
320       "chrome_main_mac.mm",
321     ]
322   }