Upstream version 10.38.222.0
[platform/framework/web/crosswalk.git] / src / chrome / chrome_resources.gyp
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.
4 {
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           ],
85           'actions': [
86             {
87               # GN version: //chrome/browser/resources:component_extension_resources
88               'action_name': 'generate_component_extension_resources',
89               'variables': {
90                 'grit_grd_file': 'browser/resources/component_extension_resources.grd',
91               },
92               'includes': [ '../build/grit_action.gypi' ],
93             },
94             {
95               # GN version: //chrome/browser/resources:options_resources
96               'action_name': 'generate_options_resources',
97               'variables': {
98                 'grit_grd_file': 'browser/resources/options_resources.grd',
99               },
100               'includes': [ '../build/grit_action.gypi' ],
101             },
102             {
103               # GN version: //chrome/browser/resources:quota_internals_resources
104               'action_name': 'generate_quota_internals_resources',
105               'variables': {
106                 'grit_grd_file': 'browser/resources/quota_internals_resources.grd',
107               },
108               'includes': [ '../build/grit_action.gypi' ],
109             },
110             {
111               # GN version: //chrome/browser/resources:sync_file_system_internals_resources
112               'action_name': 'generate_sync_file_system_internals_resources',
113               'variables': {
114                 'grit_grd_file': 'browser/resources/sync_file_system_internals_resources.grd',
115               },
116               'includes': [ '../build/grit_action.gypi' ],
117             },
118           ],
119           'copies': [
120             {
121               # GN version: //chrome/browser/resources:extension_resource_demo
122               'destination': '<(PRODUCT_DIR)/resources/extension/demo',
123               'files': [
124                 'browser/resources/extension_resource/demo/library.js',
125               ],
126             },
127           ],
128         }],
129         ['chromeos==1 and disable_nacl==0 and disable_nacl_untrusted==0', {
130           'conditions': [
131             # TODO(dtseng): Remove use_chromevox_next once ChromeVox Next is ready for testing.
132             ['use_chromevox_next==1', {
133               'dependencies': [
134                 'browser/resources/chromeos/chromevox2/chromevox.gyp:chromevox2',
135               ],
136             }, { # else use_chromevox_next == 0
137               'dependencies': [
138                 'browser/resources/chromeos/chromevox/chromevox.gyp:chromevox',
139               ],
140             }],
141           ],
142         }],
143       ],
144     },
145     {
146       # GN version: //chrome/browser:chrome_internal_resources_gen
147       'target_name': 'chrome_internal_resources_gen',
148       'type': 'none',
149       'conditions': [
150         ['branding=="Chrome"', {
151           'actions': [
152             {
153               'action_name': 'generate_transform_additional_modules_list',
154               'variables': {
155                 'additional_modules_input_path':
156                   'browser/internal/resources/additional_modules_list.input',
157                 'additional_modules_py_path':
158                   'browser/internal/transform_additional_modules_list.py',
159               },
160               'inputs': [
161                 '<(additional_modules_input_path)',
162               ],
163               'outputs': [
164                 '<(additional_modules_list_file)',
165               ],
166               'action': [
167                 'python',
168                 '<(additional_modules_py_path)',
169                 '<(additional_modules_input_path)',
170                 '<@(_outputs)',
171               ],
172               'message': 'Transforming additional modules list',
173             }
174           ],
175         }],
176       ],
177     },
178     {
179       # TODO(mark): It would be better if each static library that needed
180       # to run grit would list its own .grd files, but unfortunately some
181       # of the static libraries currently have circular dependencies among
182       # generated headers.
183       #
184       # GN version: //chrome:resources
185       'target_name': 'chrome_resources',
186       'type': 'none',
187       'dependencies': [
188         'about_credits',
189         'chrome_internal_resources_gen',
190         'chrome_web_ui_mojo_bindings.gyp:web_ui_mojo_bindings',
191       ],
192       'actions': [
193         {
194           # GN version: //chrome/browser:resources
195           'action_name': 'generate_browser_resources',
196           'variables': {
197             'grit_grd_file': 'browser/browser_resources.grd',
198             'grit_additional_defines': [
199               '-E', 'about_credits_file=<(about_credits_file)',
200               '-E', 'additional_modules_list_file=<(additional_modules_list_file)',
201               '-E', 'omnibox_mojom_file=<(omnibox_mojom_file)',
202             ],
203           },
204           'includes': [ '../build/grit_action.gypi' ],
205         },
206         {
207           # GN version: //chrome/common:resources
208           'action_name': 'generate_common_resources',
209           'variables': {
210             'grit_grd_file': 'common/common_resources.grd',
211           },
212           'includes': [ '../build/grit_action.gypi' ],
213         },
214         {
215           # GN version: //chrome/renderer:resources
216           'action_name': 'generate_renderer_resources',
217           'variables': {
218             'grit_grd_file': 'renderer/resources/renderer_resources.grd',
219           },
220           'includes': [ '../build/grit_action.gypi' ],
221         },
222       ],
223       'conditions': [
224         ['enable_extensions==1', {
225           'actions': [
226             {
227               # GN version: //chrome/common:extensions_api_resources
228               'action_name': 'generate_extensions_api_resources',
229               'variables': {
230                 'grit_grd_file': 'common/extensions_api_resources.grd',
231               },
232               'includes': [ '../build/grit_action.gypi' ],
233             }
234           ],
235         }],
236       ],
237       'includes': [ '../build/grit_target.gypi' ],
238     },
239     {
240       # TODO(mark): It would be better if each static library that needed
241       # to run grit would list its own .grd files, but unfortunately some
242       # of the static libraries currently have circular dependencies among
243       # generated headers.
244       #
245       # GN version: //chrome:strings
246       'target_name': 'chrome_strings',
247       'type': 'none',
248       'actions': [
249         {
250           # GN version: //chrome/app/resources:locale_settings
251           'action_name': 'generate_locale_settings',
252           'variables': {
253             'grit_grd_file': 'app/resources/locale_settings.grd',
254           },
255           'includes': [ '../build/grit_action.gypi' ],
256         },
257         {
258           # GN version: //chrome/app:chromium_strings
259           'action_name': 'generate_chromium_strings',
260           'variables': {
261             'grit_grd_file': 'app/chromium_strings.grd',
262           },
263           'includes': [ '../build/grit_action.gypi' ],
264         },
265         {
266           # GN version: //chrome/app:generated_resources
267           'action_name': 'generate_generated_resources',
268           'variables': {
269             'grit_grd_file': 'app/generated_resources.grd',
270           },
271           'includes': [ '../build/grit_action.gypi' ],
272         },
273         {
274           # GN version: //chrome/app:google_chrome_strings
275           'action_name': 'generate_google_chrome_strings',
276           'variables': {
277             'grit_grd_file': 'app/google_chrome_strings.grd',
278           },
279           'includes': [ '../build/grit_action.gypi' ],
280         },
281       ],
282       'includes': [ '../build/grit_target.gypi' ],
283     },
284     {
285       # GN version: //chrome/app:make_generated_resources_map
286       'target_name': 'chrome_strings_map',
287       'type': 'none',
288       'dependencies': [ 'chrome_strings', ],
289       'actions': [
290         {
291           'action_name': 'generate_resources_map',
292           'inputs': [
293             'browser/metrics/variations/generate_resources_map.py',
294             '<(grit_out_dir)/grit/generated_resources.h'
295           ],
296           'outputs': [
297             '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc',
298           ],
299           'action': [
300             'python',
301             'browser/metrics/variations/generate_resources_map.py',
302             '<(grit_out_dir)/grit/generated_resources.h',
303             '<(SHARED_INTERMEDIATE_DIR)/chrome/browser/metrics/variations/generated_resources_map.cc'
304           ],
305           'message': 'Generating generated resources map.',
306         }
307       ],
308     },
309     {
310       # GN version: //chrome/app/resources:platform_locale_settings
311       'target_name': 'platform_locale_settings',
312       'type': 'none',
313       'variables': {
314         'conditions': [
315           ['OS=="win"', {
316             'platform_locale_settings_grd':
317                 'app/resources/locale_settings_win.grd',
318           },],
319           ['OS=="linux"', {
320             'conditions': [
321               ['chromeos==1', {
322                 'conditions': [
323                   ['branding=="Chrome"', {
324                     'platform_locale_settings_grd':
325                         'app/resources/locale_settings_google_chromeos.grd',
326                   }, {  # branding!=Chrome
327                     'platform_locale_settings_grd':
328                         'app/resources/locale_settings_chromiumos.grd',
329                   }],
330                 ]
331               }, {  # chromeos==0
332                 'platform_locale_settings_grd':
333                     'app/resources/locale_settings_linux.grd',
334               }],
335             ],
336           },],
337           ['os_posix == 1 and OS != "mac" and OS != "ios" and OS != "linux"', {
338             'platform_locale_settings_grd':
339                 'app/resources/locale_settings_linux.grd',
340           },],
341           ['OS == "mac" or OS == "ios"', {
342             'platform_locale_settings_grd':
343                 'app/resources/locale_settings_mac.grd',
344           }],
345         ],  # conditions
346       },  # variables
347       'actions': [
348         {
349           'action_name': 'generate_platform_locale_settings',
350           'variables': {
351             'grit_grd_file': '<(platform_locale_settings_grd)',
352           },
353           'includes': [ '../build/grit_action.gypi' ],
354         },
355       ],
356       'includes': [ '../build/grit_target.gypi' ],
357     },
358     {
359       # GN version: //chrome/app/theme:theme_resources
360       'target_name': 'theme_resources',
361       'type': 'none',
362       'dependencies': [
363         '../ui/resources/ui_resources.gyp:ui_resources',
364         'chrome_unscaled_resources',
365       ],
366       'actions': [
367         {
368           'action_name': 'generate_theme_resources',
369           'variables': {
370             'grit_grd_file': 'app/theme/theme_resources.grd',
371           },
372           'includes': [ '../build/grit_action.gypi' ],
373         },
374       ],
375       'includes': [ '../build/grit_target.gypi' ],
376     },
377     {
378       'target_name': 'packed_extra_resources',
379       'type': 'none',
380       'dependencies': [
381         'chrome_extra_resources',
382         'packed_resources',
383       ],
384       'actions': [
385         {
386           'includes': ['chrome_repack_resources.gypi']
387         },
388       ],
389       'conditions': [
390         ['OS != "mac" and OS != "ios"', {
391           # We'll install the resource files to the product directory.  The Mac
392           # copies the results over as bundle resources in its own special way.
393           'copies': [
394             {
395               'destination': '<(PRODUCT_DIR)',
396               'files': [
397                 '<(SHARED_INTERMEDIATE_DIR)/repack/resources.pak'
398               ],
399             },
400           ],
401         }],
402       ],
403     },
404     {
405       'target_name': 'packed_resources',
406       'type': 'none',
407       'dependencies': [
408         # MSVS needs the dependencies explictly named, Make is able to
409         # derive the dependencies from the output files.
410         'chrome_resources',
411         'chrome_strings',
412         'platform_locale_settings',
413         'theme_resources',
414         '<(DEPTH)/components/components_strings.gyp:components_strings',
415         '<(DEPTH)/net/net.gyp:net_resources',
416         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
417         '<(DEPTH)/ui/strings/ui_strings.gyp:ui_strings',
418       ],
419       'actions': [
420         {
421           'action_name': 'repack_locales_pack',
422           'variables': {
423             'pak_locales': '<(locales)',
424           },
425           'includes': ['chrome_repack_locales.gypi']
426         },
427         {
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       'conditions': [
442         ['OS != "ios"', {
443           'dependencies': [
444             '<(DEPTH)/content/app/strings/content_strings.gyp:content_strings',
445             '<(DEPTH)/content/content_resources.gyp:content_resources',
446             '<(DEPTH)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
447             '<(DEPTH)/webkit/glue/resources/webkit_resources.gyp:webkit_resources',
448           ],
449         }],
450         ['use_ash==1', {
451           'dependencies': [
452              '<(DEPTH)/ash/ash_resources.gyp:ash_resources',
453              '<(DEPTH)/ash/ash_strings.gyp:ash_strings',
454           ],
455         }],
456         ['chromeos==1', {
457           'dependencies': [
458             '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_resources',
459             '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos_strings',
460           ],
461         }],
462         ['enable_autofill_dialog==1 and OS!="android"', {
463           'dependencies': [
464             '<(DEPTH)/third_party/libaddressinput/libaddressinput.gyp:libaddressinput_strings',
465           ],
466         }],
467         ['enable_extensions==1', {
468           'dependencies': [
469             '<(DEPTH)/device/bluetooth/bluetooth_strings.gyp:device_bluetooth_strings',
470             '<(DEPTH)/extensions/extensions_strings.gyp:extensions_strings',
471           ],
472         }],
473         ['OS != "mac" and OS != "ios"', {
474           # Copy pak files to the product directory. These files will be picked
475           # up by the following installer scripts:
476           #   - Windows: chrome/installer/mini_installer/chrome.release
477           #   - Linux: chrome/installer/linux/internal/common/installer.include
478           # Ensure that the above scripts are updated when adding or removing
479           # pak files.
480           # Copying files to the product directory is not needed on the Mac
481           # since the framework build phase will copy them into the framework
482           # bundle directly.
483           'copies': [
484             {
485               'destination': '<(PRODUCT_DIR)',
486               'files': [
487                 '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_100_percent.pak'
488               ],
489             },
490             {
491               'destination': '<(PRODUCT_DIR)/locales',
492               'files': [
493                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(locales))'
494               ],
495             },
496             {
497               'destination': '<(PRODUCT_DIR)/pseudo_locales',
498               'files': [
499                 '<!@pymod_do_main(repack_locales -o -p <(OS) -g <(grit_out_dir) -s <(SHARED_INTERMEDIATE_DIR) -x <(SHARED_INTERMEDIATE_DIR) <(pseudo_locales))'
500               ],
501             },
502           ],
503           'conditions': [
504             ['branding=="Chrome"', {
505               'copies': [
506                 {
507                   # This location is for the Windows and Linux builds. For
508                   # Windows, the chrome.release file ensures that these files
509                   # are copied into the installer. Note that we have a separate
510                   # section in chrome_dll.gyp to copy these files for Mac, as it
511                   # needs to be dropped inside the framework.
512                   'destination': '<(PRODUCT_DIR)/default_apps',
513                   'files': ['<@(default_apps_list)']
514                 },
515               ],
516             }],
517             ['enable_hidpi == 1', {
518               'copies': [
519                 {
520                   'destination': '<(PRODUCT_DIR)',
521                   'files': [
522                     '<(SHARED_INTERMEDIATE_DIR)/repack/chrome_200_percent.pak',
523                   ],
524                 },
525               ],
526             }],
527           ], # conditions
528         }], # end OS != "mac" and OS != "ios"
529       ], # conditions
530     },
531     {
532       # GN version: //chrome/app/theme:chrome_unscaled_resources
533       'target_name': 'chrome_unscaled_resources',
534       'type': 'none',
535       'actions': [
536         {
537           'action_name': 'generate_chrome_unscaled_resources',
538           'variables': {
539             'grit_grd_file': 'app/theme/chrome_unscaled_resources.grd',
540           },
541           'includes': [ '../build/grit_action.gypi' ],
542         },
543       ],
544       'includes': [ '../build/grit_target.gypi' ],
545     },
546     {
547       # GN version: //chrome/browser:about_credits
548       'target_name': 'about_credits',
549       'type': 'none',
550       'actions': [
551         {
552           'variables': {
553             'generator_path': '../tools/licenses.py',
554           },
555           'action_name': 'generate_about_credits',
556           'inputs': [
557             # TODO(phajdan.jr): make licenses.py print inputs too.
558             '<(generator_path)',
559           ],
560           'outputs': [
561             '<(about_credits_file)',
562           ],
563           'hard_dependency': 1,
564           'action': ['python',
565                      '<(generator_path)',
566                      'credits',
567                      '<(about_credits_file)',
568           ],
569           'message': 'Generating about:credits',
570         },
571       ],
572     },
573   ], # targets
574 }