Update CrOS OOBE throbber to MD throbber; delete old asset
[chromium-blink-merge.git] / chrome / chrome_resources.gyp
blob7f006c7dbee359979d2ee2995deba026ae7fa5b2
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     'omnibox_mojom_file': '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/ui/webui/omnibox/omnibox.mojom.js',
10   },
11   'targets': [
12     {
13       # GN version: //chrome:extra_resources
14       'target_name': 'chrome_extra_resources',
15       'type': 'none',
16       # These resources end up in resources.pak because they are resources
17       # used by internal pages.  Putting them in a separate pak file makes
18       # it easier for us to reference them internally.
19       'actions': [
20         {
21           # GN version: //chrome/browser/resources:memory_internals_resources
22           'action_name': 'generate_memory_internals_resources',
23           'variables': {
24             'grit_grd_file': 'browser/resources/memory_internals_resources.grd',
25           },
26           'includes': [ '../build/grit_action.gypi' ],
27         },
28         {
29           # GN version: //chrome/browser/resources:net_internals_resources
30           'action_name': 'generate_net_internals_resources',
31           'variables': {
32             'grit_grd_file': 'browser/resources/net_internals_resources.grd',
33           },
34           'includes': [ '../build/grit_action.gypi' ],
35         },
36         {
37           # GN version: //chrome/browser/resources:invalidations_resources
38           'action_name': 'generate_invalidations_resources',
39           'variables': {
40             'grit_grd_file': 'browser/resources/invalidations_resources.grd',
41             },
42           'includes': ['../build/grit_action.gypi' ],
43         },
44         {
45           # GN version: //chrome/browser/resources:password_manager_internals_resources
46           'action_name': 'generate_password_manager_internals_resources',
47           'variables': {
48             'grit_grd_file': 'browser/resources/password_manager_internals_resources.grd',
49           },
50           'includes': [ '../build/grit_action.gypi' ],
51         },
52         {
53           # GN version: //chrome/browser/resources:signin_internals_resources
54           'action_name': 'generate_signin_internals_resources',
55           'variables': {
56             'grit_grd_file': 'browser/resources/signin_internals_resources.grd',
57             },
58           'includes': ['../build/grit_action.gypi' ],
59         },
60         {
61           # GN version: //chrome/browser/resources:sync_internals_resources
62           'action_name': 'generate_sync_internals_resources',
63           'variables': {
64             'grit_grd_file': 'browser/resources/sync_internals_resources.grd',
65           },
66           'includes': [ '../build/grit_action.gypi' ],
67         },
68         {
69           # GN version: //chrome/browser/resources:translate_internals_resources
70           'action_name': 'generate_translate_internals_resources',
71           'variables': {
72             'grit_grd_file': 'browser/resources/translate_internals_resources.grd',
73           },
74           'includes': [ '../build/grit_action.gypi' ],
75         },
76       ],
77       'includes': [ '../build/grit_target.gypi' ],
78       'conditions': [
79         ['OS != "ios"', {
80           'dependencies': [
81             '../components/components_resources.gyp:components_resources',
82             '../content/browser/devtools/devtools_resources.gyp:devtools_resources',
83             '../content/browser/tracing/tracing_resources.gyp:tracing_resources',
84             'browser/devtools/webrtc_device_provider_resources.gyp:webrtc_device_provider_resources',
85           ],
86           'actions': [
87             {
88               # GN version: //chrome/browser/resources:component_extension_resources
89               'action_name': 'generate_component_extension_resources',
90               'variables': {
91                 'grit_grd_file': 'browser/resources/component_extension_resources.grd',
92               },
93               'includes': [ '../build/grit_action.gypi' ],
94             },
95             {
96               # GN version: //chrome/browser/resources:options_resources
97               'action_name': 'generate_options_resources',
98               'variables': {
99                 'grit_grd_file': 'browser/resources/options_resources.grd',
100               },
101               'includes': [ '../build/grit_action.gypi' ],
102             },
103             {
104               # GN version: //chrome/browser/resources:settings_resources
105               'action_name': 'generate_settings_resources',
106               'variables': {
107                 'grit_grd_file': 'browser/resources/settings/settings_resources.grd',
108               },
109               'includes': [ '../build/grit_action.gypi' ],
110             },
111           ],
112           'copies': [
113             {
114               # GN version: //chrome/browser/resources:extension_resource_demo
115               'destination': '<(PRODUCT_DIR)/resources/extension/demo',
116               'files': [
117                 'browser/resources/extension_resource/demo/library.js',
118               ],
119             },
120           ],
121         }],
122         ['chromeos==1 and disable_nacl==0 and disable_nacl_untrusted==0', {
123           'dependencies': [
124             'browser/resources/chromeos/chromevox/chromevox.gyp:chromevox',
125           ],
126         }],
127         ['enable_extensions==1', {
128           'actions': [
129             {
130               # GN version: //chrome/browser/resources:quota_internals_resources
131               'action_name': 'generate_quota_internals_resources',
132               'variables': {
133                 'grit_grd_file': 'browser/resources/quota_internals_resources.grd',
134               },
135               'includes': [ '../build/grit_action.gypi' ],
136             },
137             {
138               # GN version: //chrome/browser/resources:sync_file_system_internals_resources
139               'action_name': 'generate_sync_file_system_internals_resources',
140               'variables': {
141                 'grit_grd_file': 'browser/resources/sync_file_system_internals_resources.grd',
142               },
143               'includes': [ '../build/grit_action.gypi' ],
144             },
145           ],
146         }],
147       ],
148     },
149     {
150       # GN version: //chrome/browser:chrome_internal_resources_gen
151       'target_name': 'chrome_internal_resources_gen',
152       'type': 'none',
153       'conditions': [
154         ['branding=="Chrome"', {
155           'actions': [
156             {
157               'action_name': 'generate_transform_additional_modules_list',
158               'variables': {
159                 'additional_modules_input_path':
160                   'browser/internal/resources/additional_modules_list.input',
161                 'additional_modules_py_path':
162                   'browser/internal/transform_additional_modules_list.py',
163               },
164               'inputs': [
165                 '<(additional_modules_input_path)',
166               ],
167               'outputs': [
168                 '<(additional_modules_list_file)',
169               ],
170               'action': [
171                 'python',
172                 '<(additional_modules_py_path)',
173                 '<(additional_modules_input_path)',
174                 '<@(_outputs)',
175               ],
176               'message': 'Transforming additional modules list',
177             }
178           ],
179         }],
180       ],
181     },
182     {
183       # TODO(mark): It would be better if each static library that needed
184       # to run grit would list its own .grd files, but unfortunately some
185       # of the static libraries currently have circular dependencies among
186       # generated headers.
187       #
188       # GN version: //chrome:resources
189       'target_name': 'chrome_resources',
190       'type': 'none',
191       'dependencies': [
192         'about_credits',
193         'chrome_internal_resources_gen',
194         'chrome_web_ui_mojo_bindings.gyp:web_ui_mojo_bindings',
195       ],
196       'actions': [
197         {
198           # GN version: //chrome/browser:resources
199           'action_name': 'generate_browser_resources',
200           'variables': {
201             'grit_grd_file': 'browser/browser_resources.grd',
202             'grit_additional_defines': [
203               '-E', 'about_credits_file=<(about_credits_file)',
204               '-E', 'additional_modules_list_file=<(additional_modules_list_file)',
205               '-E', 'omnibox_mojom_file=<(omnibox_mojom_file)',
206             ],
207           },
208           'includes': [ '../build/grit_action.gypi' ],
209         },
210         {
211           # GN version: //chrome/common:resources
212           'action_name': 'generate_common_resources',
213           'variables': {
214             'grit_grd_file': 'common/common_resources.grd',
215           },
216           'includes': [ '../build/grit_action.gypi' ],
217         },
218         {
219           # GN version: //chrome/renderer:resources
220           'action_name': 'generate_renderer_resources',
221           'variables': {
222             'grit_grd_file': 'renderer/resources/renderer_resources.grd',
223           },
224           'includes': [ '../build/grit_action.gypi' ],
225         },
226       ],
227       'conditions': [
228         ['enable_extensions==1', {
229           'actions': [
230             {
231               # GN version: //chrome/common:extensions_api_resources
232               'action_name': 'generate_extensions_api_resources',
233               'variables': {
234                 'grit_grd_file': 'common/extensions_api_resources.grd',
235               },
236               'includes': [ '../build/grit_action.gypi' ],
237             }
238           ],
239         }],
240       ],
241       'includes': [ '../build/grit_target.gypi' ],
242     },
243     {
244       # TODO(mark): It would be better if each static library that needed
245       # to run grit would list its own .grd files, but unfortunately some
246       # of the static libraries currently have circular dependencies among
247       # generated headers.
248       #
249       # GN version: //chrome:strings
250       'target_name': 'chrome_strings',
251       'type': 'none',
252       'actions': [
253         {
254           # GN version: //chrome/app/resources:locale_settings
255           'action_name': 'generate_locale_settings',
256           'variables': {
257             'grit_grd_file': 'app/resources/locale_settings.grd',
258           },
259           'includes': [ '../build/grit_action.gypi' ],
260         },
261         {
262           # GN version: //chrome/app:chromium_strings
263           'action_name': 'generate_chromium_strings',
264           'variables': {
265             'grit_grd_file': 'app/chromium_strings.grd',
266           },
267           'includes': [ '../build/grit_action.gypi' ],
268         },
269         {
270           # GN version: //chrome/app:generated_resources
271           'action_name': 'generate_generated_resources',
272           'variables': {
273             'grit_grd_file': 'app/generated_resources.grd',
274           },
275           'includes': [ '../build/grit_action.gypi' ],
276         },
277         {
278           # GN version: //chrome/app:google_chrome_strings
279           'action_name': 'generate_google_chrome_strings',
280           'variables': {
281             'grit_grd_file': 'app/google_chrome_strings.grd',
282           },
283           'includes': [ '../build/grit_action.gypi' ],
284         },
285       ],
286     },
287     {
288       # GN version: //chrome/app:make_generated_resources_map
289       'target_name': 'chrome_strings_map',
290       'type': 'none',
291       'dependencies': [ 'chrome_strings', ],
292       'actions': [
293         {
294           'action_name': 'generate_resources_map',
295           'inputs': [
296             'browser/metrics/variations/generate_resources_map.py',
297             '<(grit_out_dir)/grit/generated_resources.h'
298           ],
299           'outputs': [
300             '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc',
301           ],
302           'action': [
303             'python',
304             'browser/metrics/variations/generate_resources_map.py',
305             '<(grit_out_dir)/grit/generated_resources.h',
306             '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc'
307           ],
308           'message': 'Generating generated resources map.',
309         }
310       ],
311     },
312     {
313       # GN version: //chrome/app/resources:platform_locale_settings
314       'target_name': 'platform_locale_settings',
315       'type': 'none',
316       'variables': {
317         'conditions': [
318           ['OS=="win"', {
319             'platform_locale_settings_grd':
320                 'app/resources/locale_settings_win.grd',
321           },],
322           ['OS=="linux"', {
323             'conditions': [
324               ['chromeos==1', {
325                 'platform_locale_settings_grd':
326                     'app/resources/locale_settings_<(branding_path_component)os.grd',
327               }, {  # chromeos==0
328                 'platform_locale_settings_grd':
329                     'app/resources/locale_settings_linux.grd',
330               }],
331             ],
332           },],
333           ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "linux"', {
334             'platform_locale_settings_grd':
335                 'app/resources/locale_settings_linux.grd',
336           },],
337           ['OS == "mac" or OS == "ios"', {
338             'platform_locale_settings_grd':
339                 'app/resources/locale_settings_mac.grd',
340           }],
341         ],  # conditions
342       },  # variables
343       'actions': [
344         {
345           'action_name': 'generate_platform_locale_settings',
346           'variables': {
347             'grit_grd_file': '<(platform_locale_settings_grd)',
348           },
349           'includes': [ '../build/grit_action.gypi' ],
350         },
351       ],
352       'includes': [ '../build/grit_target.gypi' ],
353     },
354     {
355       # GN version: //chrome/app/theme:theme_resources
356       'target_name': 'theme_resources',
357       'type': 'none',
358       'dependencies': [
359         '../ui/resources/ui_resources.gyp:ui_resources',
360         'chrome_unscaled_resources',
361       ],
362       'actions': [
363         {
364           'action_name': 'generate_theme_resources',
365           'variables': {
366             'grit_grd_file': 'app/theme/theme_resources.grd',
367           },
368           'includes': [ '../build/grit_action.gypi' ],
369         },
370       ],
371       'includes': [ '../build/grit_target.gypi' ],
372     },
373     {
374       # GN version: //chrome:packed_extra_resources
375       'target_name': 'packed_extra_resources',
376       'type': 'none',
377       'dependencies': [
378         'chrome_extra_resources',
379         'packed_resources',
380       ],
381       'actions': [
382         {
383           'includes': ['chrome_repack_resources.gypi']
384         },
385       ],
386       'conditions': [
387         ['OS != "mac" and OS != "ios"', {
388           # We'll install the resource files to the product directory.  The Mac
389           # copies the results over as bundle resources in its own special way.
390           'copies': [
391             {
392               'destination': '<(PRODUCT_DIR)',
393               'files': [
394                 '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak'
395               ],
396             },
397           ],
398         }],
399       ],
400     },
401     {
402       # GN version: //chrome:packed_resources
403       'target_name': 'packed_resources',
404       'type': 'none',
405       'dependencies': [  # Update duplicate logic in repack_locales.py
406         # MSVS needs the dependencies explictly named, Make is able to
407         # derive the dependencies from the output files.
408         'chrome_resources',
409         'chrome_strings',
410         'platform_locale_settings',
411         'theme_resources',
412         '<(DEPTH)/components/components_strings.gyp:components_strings',
413         '<(DEPTH)/net/net.gyp:net_resources',
414         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
415         '<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
416       ],
417       'actions': [
418         {
419           # GN version: //chrome:repack_locales_pack
420           'action_name': 'repack_locales_pack',
421           'variables': {
422             'pak_locales': '<(locales)',
423           },
424           'includes': ['chrome_repack_locales.gypi']
425         },
426         {
427           # GN version: //chrome:repack_pseudo_locales_pack
428           'action_name': 'repack_pseudo_locales_pack',
429           'variables': {
430             'pak_locales': '<(pseudo_locales)',
431           },
432           'includes': ['chrome_repack_locales.gypi']
433         },
434         {
435           'includes': ['chrome_repack_chrome_100_percent.gypi']
436         },
437         {
438           'includes': ['chrome_repack_chrome_200_percent.gypi']
439         },
440         {
441           'includes': ['chrome_repack_chrome_material_100_percent.gypi']
442         },
443         {
444           'includes': ['chrome_repack_chrome_material_200_percent.gypi']
445         },
446       ],
447       'conditions': [  # GN version: chrome_repack_locales.gni template("_repack_one_locale")
448         ['OS != "ios"', {
449           'dependencies': [  # Update duplicate logic in repack_locales.py
450             '<(DEPTH)/content/app/resources/content_resources.gyp:content_resources',
451             '<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
452             '<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:bluetooth_strings',
453             '<(DEPTH)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
454           ],
455         }, {  # else
456           'dependencies': [  # Update duplicate logic in repack_locales.py
457             '<(DEPTH)/ios/chrome/ios_chrome_resources.gyp:ios_strings_resources_gen',
458           ],
459           'actions': [
460             {
461               'includes': ['chrome_repack_chrome_300_percent.gypi']
462             },
463           ],
464         }],
465         ['use_ash==1', {
466           'dependencies': [  # Update duplicate logic in repack_locales.py
467              '<(DEPTH)/ash/ash_resources.gyp:ash_resources',
468              '<(DEPTH)/ash/ash_strings.gyp:ash_strings',
469           ],
470         }],
471         ['toolkit_views==1', {
472           'dependencies': [
473              '<(DEPTH)/ui/views/resources/views_resources.gyp:views_resources',
474           ],
475         }],
476         ['chromeos==1', {
477           'dependencies': [  # Update duplicate logic in repack_locales.py
478             '<(DEPTH)/remoting/remoting.gyp:remoting_resources',
479             '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources',
480             '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',
481           ],
482         }],
483         ['enable_autofill_dialog==1 and OS!="android"', {
484           'dependencies': [  # Update duplicate logic in repack_locales.py
485             '<(DEPTH)/third_party/libaddressinput/libaddressinput.gyp:libaddressinput_strings',
486           ],
487         }],
488         ['enable_extensions==1', {
489           'dependencies': [  # Update duplicate logic in repack_locales.py
490             '<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
491           ],
492         }],
493         ['enable_app_list==1', {
494           'dependencies': [
495              '<(DEPTH)/ui/app_list/resources/app_list_resources.gyp:app_list_resources',
496           ],
497         }],
498         ['OS != "mac" and OS != "ios"', {
499           # Copy pak files to the product directory. These files will be picked
500           # up by the following installer scripts:
501           #   - Windows: chrome/installer/mini_installer/chrome.release
502           #   - Linux: chrome/installer/linux/internal/common/installer.include
503           # Ensure that the above scripts are updated when adding or removing
504           # pak files.
505           # Copying files to the product directory is not needed on the Mac
506           # since the framework build phase will copy them into the framework
507           # bundle directly.
508           'copies': [
509             {
510               'destination': '<(PRODUCT_DIR)',
511               'files': [
512                 '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak'
513               ],
514             },
515             {
516               'destination': '<(PRODUCT_DIR)/locales',
517               'files': [
518                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))'
519               ],
520             },
521             {
522               'destination': '<(PRODUCT_DIR)/pseudo_locales',
523               'files': [
524                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pseudo_locales))'
525               ],
526             },
527           ],
528           'conditions': [
529             ['branding=="Chrome"', {
530               'copies': [
531                 {
532                   # This location is for the Windows and Linux builds. For
533                   # Windows, the chrome.release file ensures that these files
534                   # are copied into the installer. Note that we have a separate
535                   # section in chrome_dll.gyp to copy these files for Mac, as it
536                   # needs to be dropped inside the framework.
537                   'destination': '<(PRODUCT_DIR)/default_apps',
538                   'files': ['<@(default_apps_list)']
539                 },
540               ],
541             }],
542             ['enable_hidpi == 1', {
543               'copies': [
544                 {
545                   'destination': '<(PRODUCT_DIR)',
546                   'files': [
547                     '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_200_percent.pak',
548                   ],
549                 },
550               ],
551             }],
552             ['enable_topchrome_md == 1', {
553               'copies': [
554                 {
555                   'destination': '<(PRODUCT_DIR)',
556                   'files': [
557                     '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_material_100_percent.pak',
558                   ],
559                 },
560               ],
561             }],
562             ['enable_hidpi == 1 and enable_topchrome_md == 1', {
563               'copies': [
564                 {
565                   'destination': '<(PRODUCT_DIR)',
566                   'files': [
567                     '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_material_200_percent.pak',
568                   ],
569                 },
570               ],
571             }],
572           ], # conditions
573         }], # end OS != "mac" and OS != "ios"
574       ], # conditions
575     },
576     {
577       # GN version: //chrome/app/theme:chrome_unscaled_resources
578       'target_name': 'chrome_unscaled_resources',
579       'type': 'none',
580       'actions': [
581         {
582           'action_name': 'generate_chrome_unscaled_resources',
583           'variables': {
584             'grit_grd_file': 'app/theme/chrome_unscaled_resources.grd',
585           },
586           'includes': [ '../build/grit_action.gypi' ],
587         },
588       ],
589       'includes': [ '../build/grit_target.gypi' ],
590     },
591     {
592       # GN version: //chrome/browser/resources:options_test_resources
593       'target_name': 'options_test_resources',
594       'type': 'none',
595       'actions': [
596         {
597           'action_name': 'generate_options_test_resources',
598           'variables': {
599             'grit_grd_file': 'browser/resources/options_test_resources.grd',
600           },
601           'includes': [ '../build/grit_action.gypi' ],
602         },
603       ],
604       'includes': [ '../build/grit_target.gypi' ],
605     },
606     {
607       # GN version: //chrome/test/data/resources:webui_test_resources
608       'target_name': 'webui_test_resources',
609       'type': 'none',
610       'actions': [
611         {
612           'action_name': 'generate_webui_test_resources',
613           'variables': {
614             'grit_grd_file': 'test/data/webui_test_resources.grd',
615           },
616           'includes': [ '../build/grit_action.gypi' ],
617         },
618       ],
619       'includes': [ '../build/grit_target.gypi' ],
620     },
621     {
622       # GN version: //chrome:browser_tests_pak
623       'target_name': 'browser_tests_pak',
624       'type': 'none',
625       'dependencies': [
626         'options_test_resources',
627         'webui_test_resources',
628       ],
629       'actions': [
630         {
631           'action_name': 'repack_browser_tests_pak',
632           'variables': {
633             'pak_inputs': [
634               '<(SHARED_INTERMEDIATE_DIR)/chrome/options_test_resources.pak',
635               '<(SHARED_INTERMEDIATE_DIR)/chrome/webui_test_resources.pak',
636             ],
637             'pak_output': '<(PRODUCT_DIR)/browser_tests.pak',
638           },
639           'includes': [ '../build/repack_action.gypi' ],
640         },
641       ],
642     },
643     {
644       # GN version: //chrome/browser:about_credits
645       'target_name': 'about_credits',
646       'type': 'none',
647       'actions': [
648         {
649           'variables': {
650             'generator_path': '../tools/licenses.py',
651           },
652           'action_name': 'generate_about_credits',
653           'inputs': [
654             # TODO(phajdan.jr): make licenses.py print license input files so
655             # about:credits gets rebuilt when one changes.
656             '<(generator_path)',
657             'browser/resources/about_credits.tmpl',
658             'browser/resources/about_credits_entry.tmpl',
659           ],
660           'outputs': [
661             '<(about_credits_file)',
662           ],
663           'hard_dependency': 1,
664           'action': ['python',
665                      '<(generator_path)',
666                      'credits',
667                      '<(about_credits_file)',
668           ],
669           'message': 'Generating about:credits',
670         },
671       ],
672     },
673   ], # targets