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