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