Add very simple loading test for non-SFI NaCl.
[chromium-blink-merge.git] / chrome / chrome_resources.gyp
blobbbb2c4071432b768da1a482cc9e109d74aabcc6b
1 # Copyright (c) 2012 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   'variables': {
6     'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
7     'about_credits_file': '<(SHARED_INTERMEDIATE_DIR)/about_credits.html',
8     'additional_modules_list_file': '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/internal/additional_modules_list.txt',
9     'repack_locales_cmd': ['python', 'tools/build/repack_locales.py'],
10   },
11   'targets': [
12     {
13       'target_name': 'chrome_extra_resources',
14       'type': 'none',
15       # These resources end up in resources.pak because they are resources
16       # used by internal pages.  Putting them in a separate pak file makes
17       # it easier for us to reference them internally.
18       'actions': [
19         {
20           'action_name': 'memory_internals_resources',
21           'variables': {
22             'grit_grd_file': 'browser/resources/memory_internals_resources.grd',
23           },
24           'includes': [ '../build/grit_action.gypi' ],
25         },
26         {
27           'action_name': 'net_internals_resources',
28           'variables': {
29             'grit_grd_file': 'browser/resources/net_internals_resources.grd',
30           },
31           'includes': [ '../build/grit_action.gypi' ],
32         },
33         {
34           'action_name': 'invalidations_resources',
35           'variables': {
36             'grit_grd_file': 'browser/resources/invalidations_resources.grd',
37             },
38           'includes': ['../build/grit_action.gypi' ],
39         },
40         {
41           'action_name': 'password_manager_internals_resources',
42           'variables': {
43             'grit_grd_file': 'browser/resources/password_manager_internals_resources.grd',
44           },
45           'includes': [ '../build/grit_action.gypi' ],
46         },
47         {
48           'action_name': 'signin_internals_resources',
49           'variables': {
50             'grit_grd_file': 'browser/resources/signin_internals_resources.grd',
51             },
52           'includes': ['../build/grit_action.gypi' ],
53         },
54         {
55           'action_name': 'sync_internals_resources',
56           'variables': {
57             'grit_grd_file': 'browser/resources/sync_internals_resources.grd',
58           },
59           'includes': [ '../build/grit_action.gypi' ],
60         },
61         {
62           'action_name': 'translate_internals_resources',
63           'variables': {
64             'grit_grd_file': 'browser/resources/translate_internals_resources.grd',
65           },
66           'includes': [ '../build/grit_action.gypi' ],
67         },
68       ],
69       'includes': [ '../build/grit_target.gypi' ],
70       'conditions': [
71         ['OS != "ios"', {
72           'dependencies': [
73             '../components/component_resources.gyp:component_resources',
74             '../content/browser/devtools/devtools_resources.gyp:devtools_resources',
75             '../content/browser/tracing/tracing_resources.gyp:tracing_resources',
76           ],
77           'actions': [
78             {
79               'action_name': 'component_extension_resources',
80               'variables': {
81                 'grit_grd_file': 'browser/resources/component_extension_resources.grd',
82               },
83               'includes': [ '../build/grit_action.gypi' ],
84             },
85             {
86               'action_name': 'options_resources',
87               'variables': {
88                 'grit_grd_file': 'browser/resources/options_resources.grd',
89               },
90               'includes': [ '../build/grit_action.gypi' ],
91             },
92             {
93               'action_name': 'quota_internals_resources',
94               'variables': {
95                 'grit_grd_file': 'browser/resources/quota_internals_resources.grd',
96               },
97               'includes': [ '../build/grit_action.gypi' ],
98             },
99             {
100               'action_name': 'sync_file_system_internals_resources',
101               'variables': {
102                 'grit_grd_file': 'browser/resources/sync_file_system_internals_resources.grd',
103               },
104               'includes': [ '../build/grit_action.gypi' ],
105             },
106           ],
107           'copies': [
108             {
109               'destination': '<(PRODUCT_DIR)/resources/extension/demo',
110               'files': [
111                 'browser/resources/extension_resource/demo/library.js',
112               ],
113             },
114           ],
115         }],
116         ['chromeos==1 and disable_nacl==0 and disable_nacl_untrusted==0', {
117           'dependencies': [
118             '../chrome/third_party/chromevox/chromevox.gyp:chromevox_resources',
119           ],
120         }],
121       ],
122     },
123     {
124       'target_name': 'chrome_internal_resources_gen',
125       'type': 'none',
126       'conditions': [
127         ['branding=="Chrome"', {
128           'actions': [
129             {
130               'action_name': 'transform_additional_modules_list',
131               'variables': {
132                 'additional_modules_input_path':
133                   'browser/internal/resources/additional_modules_list.input',
134                 'additional_modules_py_path':
135                   'browser/internal/transform_additional_modules_list.py',
136               },
137               'inputs': [
138                 '<(additional_modules_input_path)',
139               ],
140               'outputs': [
141                 '<(additional_modules_list_file)',
142               ],
143               'action': [
144                 'python',
145                 '<(additional_modules_py_path)',
146                 '<(additional_modules_input_path)',
147                 '<@(_outputs)',
148               ],
149               'message': 'Transforming additional modules list',
150             }
151           ],
152         }],
153       ],
154     },
155     {
156       # TODO(mark): It would be better if each static library that needed
157       # to run grit would list its own .grd files, but unfortunately some
158       # of the static libraries currently have circular dependencies among
159       # generated headers.
160       'target_name': 'chrome_resources',
161       'type': 'none',
162       'dependencies': [
163         'about_credits',
164         'chrome_internal_resources_gen',
165       ],
166       'actions': [
167         # Data resources.
168         {
169           'action_name': 'browser_resources',
170           'variables': {
171             'grit_grd_file': 'browser/browser_resources.grd',
172             'grit_additional_defines': [
173               '-E', 'about_credits_file=<(about_credits_file)',
174               '-E', 'additional_modules_list_file=<(additional_modules_list_file)',
175             ],
176           },
177           'includes': [ '../build/grit_action.gypi' ],
178         },
179         {
180           'action_name': 'common_resources',
181           'variables': {
182             'grit_grd_file': 'common/common_resources.grd',
183           },
184           'includes': [ '../build/grit_action.gypi' ],
185         },
186         {
187           'action_name': 'renderer_resources',
188           'variables': {
189             'grit_grd_file': 'renderer/resources/renderer_resources.grd',
190           },
191           'includes': [ '../build/grit_action.gypi' ],
192         },
193       ],
194       'conditions': [
195         ['enable_extensions==1', {
196           'actions': [
197             {
198               'action_name': 'extensions_api_resources',
199               'variables': {
200                 'grit_grd_file': 'common/extensions_api_resources.grd',
201               },
202               'includes': [ '../build/grit_action.gypi' ],
203             }
204           ],
205         }],
206       ],
207       'includes': [ '../build/grit_target.gypi' ],
208     },
209     {
210       # TODO(mark): It would be better if each static library that needed
211       # to run grit would list its own .grd files, but unfortunately some
212       # of the static libraries currently have circular dependencies among
213       # generated headers.
214       'target_name': 'chrome_strings',
215       'type': 'none',
216       'actions': [
217         # Localizable resources.
218         {
219           'action_name': 'locale_settings',
220           'variables': {
221             'grit_grd_file': 'app/resources/locale_settings.grd',
222           },
223           'includes': [ '../build/grit_action.gypi' ],
224         },
225         {
226           'action_name': 'chromium_strings.grd',
227           'variables': {
228             'grit_grd_file': 'app/chromium_strings.grd',
229           },
230           'includes': [ '../build/grit_action.gypi' ],
231         },
232         {
233           'action_name': 'generated_resources',
234           'variables': {
235             'grit_grd_file': 'app/generated_resources.grd',
236           },
237           'includes': [ '../build/grit_action.gypi' ],
238         },
239         {
240           'action_name': 'google_chrome_strings',
241           'variables': {
242             'grit_grd_file': 'app/google_chrome_strings.grd',
243           },
244           'includes': [ '../build/grit_action.gypi' ],
245         },
246       ],
247       'includes': [ '../build/grit_target.gypi' ],
248     },
249     {
250       'target_name': 'platform_locale_settings',
251       'type': 'none',
252       'variables': {
253         'conditions': [
254           ['OS=="win"', {
255             'platform_locale_settings_grd':
256                 'app/resources/locale_settings_win.grd',
257           },],
258           ['OS=="linux"', {
259             'conditions': [
260               ['chromeos==1', {
261                 'conditions': [
262                   ['branding=="Chrome"', {
263                     'platform_locale_settings_grd':
264                         'app/resources/locale_settings_google_chromeos.grd',
265                   }, {  # branding!=Chrome
266                     'platform_locale_settings_grd':
267                         'app/resources/locale_settings_chromiumos.grd',
268                   }],
269                 ]
270               }, {  # chromeos==0
271                 'platform_locale_settings_grd':
272                     'app/resources/locale_settings_linux.grd',
273               }],
274             ],
275           },],
276           ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "linux"', {
277             'platform_locale_settings_grd':
278                 'app/resources/locale_settings_linux.grd',
279           },],
280           ['OS == "mac" or OS == "ios"', {
281             'platform_locale_settings_grd':
282                 'app/resources/locale_settings_mac.grd',
283           }],
284         ],  # conditions
285       },  # variables
286       'actions': [
287         {
288           'action_name': 'platform_locale_settings',
289           'variables': {
290             'grit_grd_file': '<(platform_locale_settings_grd)',
291           },
292           'includes': [ '../build/grit_action.gypi' ],
293         },
294       ],
295       'includes': [ '../build/grit_target.gypi' ],
296     },
297     {
298       'target_name': 'theme_resources_gen',
299       'type': 'none',
300       'actions': [
301         {
302           'action_name': 'theme_resources',
303           'variables': {
304             'grit_grd_file': 'app/theme/theme_resources.grd',
305           },
306           'includes': [ '../build/grit_action.gypi' ],
307         },
308       ],
309       'includes': [ '../build/grit_target.gypi' ],
310     },
311     {
312       'target_name': 'theme_resources',
313       'type': 'none',
314       'dependencies': [
315         'chrome_unscaled_resources',
316         'theme_resources_gen',
317         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
318       ],
319     },
320     {
321       'target_name': 'packed_extra_resources',
322       'type': 'none',
323       'variables': {
324         'repack_path': '../tools/grit/grit/format/repack.py',
325       },
326       'dependencies': [
327         'chrome_extra_resources',
328         'packed_resources',
329       ],
330       'actions': [
331         {
332           'includes': ['chrome_repack_resources.gypi']
333         },
334       ],
335       'conditions': [
336         ['OS != "mac" and OS != "ios"', {
337           # We'll install the resource files to the product directory.  The Mac
338           # copies the results over as bundle resources in its own special way.
339           'copies': [
340             {
341               'destination': '<(PRODUCT_DIR)',
342               'files': [
343                 '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak'
344               ],
345             },
346           ],
347         }],
348       ],
349     },
350     {
351       'target_name': 'packed_resources',
352       'type': 'none',
353       'variables': {
354         'repack_path': '../tools/grit/grit/format/repack.py',
355       },
356       'dependencies': [
357         # MSVS needs the dependencies explictly named, Make is able to
358         # derive the dependencies from the output files.
359         'chrome_resources',
360         'chrome_strings',
361         'platform_locale_settings',
362         'theme_resources',
363         '<(DEPTH)/components/component_strings.gyp:component_strings',
364         '<(DEPTH)/net/net.gyp:net_resources',
365         '<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings',
366         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
367       ],
368       'actions': [
369         {
370           'includes': ['chrome_repack_locales.gypi']
371         },
372         {
373           'includes': ['chrome_repack_pseudo_locales.gypi']
374         },
375         {
376           'includes': ['chrome_repack_chrome_100_percent.gypi']
377         },
378         {
379           'includes': ['chrome_repack_chrome_200_percent.gypi']
380         },
381       ],
382       'conditions': [
383         ['OS != "ios"', {
384           'dependencies': [
385             '<(DEPTH)/content/content_resources.gyp:content_resources',
386             '<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings',
387             '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
388             '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
389           ],
390         }],
391         ['use_ash==1', {
392           'dependencies': [
393              '<(DEPTH)/ash/ash_strings.gyp:ash_strings',
394              '<(DEPTH)/ash/ash.gyp:ash_resources',
395           ],
396         }],
397         ['enable_autofill_dialog==1 and OS!="android"', {
398           'dependencies': [
399             '<(DEPTH)/third_party/libaddressinput/libaddressinput.gyp:libaddressinput_strings',
400           ],
401         }],
402         ['OS != "mac" and OS != "ios"', {
403           # Copy pak files to the product directory. These files will be picked
404           # up by the following installer scripts:
405           #   - Windows: chrome/installer/mini_installer/chrome.release
406           #   - Linux: chrome/installer/linux/internal/common/installer.include
407           # Ensure that the above scripts are updated when adding or removing
408           # pak files.
409           # Copying files to the product directory is not needed on the Mac
410           # since the framework build phase will copy them into the framework
411           # bundle directly.
412           'copies': [
413             {
414               'destination': '<(PRODUCT_DIR)',
415               'files': [
416                 '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak'
417               ],
418             },
419             {
420               'destination': '<(PRODUCT_DIR)/locales',
421               'files': [
422                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))'
423               ],
424             },
425             {
426               'destination': '<(PRODUCT_DIR)/pseudo_locales',
427               'files': [
428                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pseudo_locales))'
429               ],
430             },
431           ],
432           'conditions': [
433             ['branding=="Chrome"', {
434               'copies': [
435                 {
436                   # This location is for the Windows and Linux builds. For
437                   # Windows, the chrome.release file ensures that these files
438                   # are copied into the installer. Note that we have a separate
439                   # section in chrome_dll.gyp to copy these files for Mac, as it
440                   # needs to be dropped inside the framework.
441                   'destination': '<(PRODUCT_DIR)/default_apps',
442                   'files': ['<@(default_apps_list)']
443                 },
444               ],
445             }],
446             ['enable_hidpi == 1', {
447               'copies': [
448                 {
449                   'destination': '<(PRODUCT_DIR)',
450                   'files': [
451                     '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_200_percent.pak',
452                   ],
453                 },
454               ],
455             }],
456           ], # conditions
457         }], # end OS != "mac" and OS != "ios"
458       ], # conditions
459     },
460     {
461       'target_name': 'chrome_unscaled_resources',
462       'type': 'none',
463       'variables': {
464         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/chrome',
465       },
466       'actions': [
467         {
468           'action_name': 'chrome_unscaled_resources',
469           'variables': {
470             'grit_grd_file': 'app/theme/chrome_unscaled_resources.grd',
471           },
472           'includes': [ '../build/grit_action.gypi' ],
473         },
474       ],
475       'includes': [ '../build/grit_target.gypi' ],
476     },
477     {
478       'target_name': 'about_credits',
479       'type': 'none',
480       'actions': [
481         {
482           'variables': {
483             'generator_path': '../tools/licenses.py',
484           },
485           'action_name': 'generate_about_credits',
486           'inputs': [
487             # TODO(phajdan.jr): make licenses.py print inputs too.
488             '<(generator_path)',
489           ],
490           'outputs': [
491             '<(about_credits_file)',
492           ],
493           'hard_dependency': 1,
494           'action': ['python',
495                      '<(generator_path)',
496                      'credits',
497                      '<(about_credits_file)',
498           ],
499           'message': 'Generating about:credits',
500         },
501       ],
502     },
503   ], # targets