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