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