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