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