Revert of Split ui/base/ime into a new component (patchset #4 id:60001 of https:...
[chromium-blink-merge.git] / extensions / shell / app_shell.gyp
blob1666e434edd0fc817f029e450da0492b3c1947ec
1 # Copyright 2014 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.
6   'variables': {
7     # Product name is used for Mac bundle.
8     'app_shell_product_name': 'App Shell',
9     # The version is high enough to be supported by Omaha (at least 31)
10     # but fake enough to be obviously not a Chrome release.
11     'app_shell_version': '38.1234.5678.9',
12     'chromium_code': 1,
13   },
14   'targets': [
15     {
16       'target_name': 'app_shell_lib',
17       'type': 'static_library',
18       'dependencies': [
19         'app_shell_version_header',
20         '<(DEPTH)/base/base.gyp:base',
21         '<(DEPTH)/base/base.gyp:base_prefs',
22         '<(DEPTH)/components/components.gyp:pref_registry',
23         '<(DEPTH)/components/components.gyp:update_client',
24         '<(DEPTH)/components/components.gyp:user_prefs',
25         '<(DEPTH)/components/components.gyp:web_cache_renderer',
26         '<(DEPTH)/content/content.gyp:content',
27         '<(DEPTH)/content/content.gyp:content_browser',
28         '<(DEPTH)/content/content.gyp:content_gpu',
29         '<(DEPTH)/content/content.gyp:content_ppapi_plugin',
30         '<(DEPTH)/content/content_shell_and_tests.gyp:content_shell_lib',
31         '<(DEPTH)/device/core/core.gyp:device_core',
32         '<(DEPTH)/device/hid/hid.gyp:device_hid',
33         '<(DEPTH)/extensions/browser/api/api_registration.gyp:extensions_api_registration',
34         '<(DEPTH)/extensions/common/api/api.gyp:extensions_api',
35         '<(DEPTH)/extensions/extensions.gyp:extensions_browser',
36         '<(DEPTH)/extensions/extensions.gyp:extensions_common',
37         '<(DEPTH)/extensions/extensions.gyp:extensions_renderer',
38         '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
39         '<(DEPTH)/extensions/extensions.gyp:extensions_utility',
40         '<(DEPTH)/extensions/extensions_resources.gyp:extensions_resources',
41         '<(DEPTH)/extensions/shell/browser/api/api_registration.gyp:shell_api_registration',
42         '<(DEPTH)/extensions/shell/common/api/api.gyp:shell_api',
43         '<(DEPTH)/mojo/mojo_base.gyp:mojo_environment_chromium',
44         '<(DEPTH)/skia/skia.gyp:skia',
45         '<(DEPTH)/third_party/WebKit/public/blink.gyp:blink',
46         '<(DEPTH)/third_party/mojo/mojo_edk.gyp:mojo_system_impl',
47         '<(DEPTH)/v8/tools/gyp/v8.gyp:v8',
48       ],
49       'export_dependent_settings': [
50         '<(DEPTH)/content/content.gyp:content_browser',
51       ],
52       'include_dirs': [
53         '../..',
54         '<(SHARED_INTERMEDIATE_DIR)',
55         '<(SHARED_INTERMEDIATE_DIR)/extensions/shell',
56       ],
57       'sources': [
58         'app/paths_mac.h',
59         'app/paths_mac.mm',
60         'app/shell_main_delegate.cc',
61         'app/shell_main_delegate.h',
62         'browser/api/identity/identity_api.cc',
63         'browser/api/identity/identity_api.h',
64         'browser/shell_browser_context_keyed_service_factories.cc',
65         'browser/shell_browser_context_keyed_service_factories.h',
66         'browser/default_shell_browser_main_delegate.cc',
67         'browser/default_shell_browser_main_delegate.h',
68         'browser/desktop_controller.cc',
69         'browser/desktop_controller.h',
70         'browser/media_capture_util.cc',
71         'browser/media_capture_util.h',
72         'browser/shell_app_delegate.cc',
73         'browser/shell_app_delegate.h',
74         'browser/shell_app_view_guest_delegate.cc',
75         'browser/shell_app_view_guest_delegate.h',
76         'browser/shell_app_window_client.cc',
77         'browser/shell_app_window_client.h',
78         'browser/shell_app_window_client_mac.mm',
79         'browser/shell_audio_controller_chromeos.cc',
80         'browser/shell_audio_controller_chromeos.h',
81         'browser/shell_browser_context.cc',
82         'browser/shell_browser_context.h',
83         'browser/shell_browser_main_delegate.h',
84         'browser/shell_browser_main_parts.cc',
85         'browser/shell_browser_main_parts.h',
86         'browser/shell_browser_main_parts_mac.h',
87         'browser/shell_browser_main_parts_mac.mm',
88         'browser/shell_content_browser_client.cc',
89         'browser/shell_content_browser_client.h',
90         'browser/shell_desktop_controller_mac.h',
91         'browser/shell_desktop_controller_mac.mm',
92         'browser/shell_device_client.cc',
93         'browser/shell_device_client.h',
94         'browser/shell_display_info_provider.cc',
95         'browser/shell_display_info_provider.h',
96         'browser/shell_extension_host_delegate.cc',
97         'browser/shell_extension_host_delegate.h',
98         'browser/shell_extension_system.cc',
99         'browser/shell_extension_system.h',
100         'browser/shell_extension_system_factory.cc',
101         'browser/shell_extension_system_factory.h',
102         'browser/shell_extension_web_contents_observer.cc',
103         'browser/shell_extension_web_contents_observer.h',
104         'browser/shell_extensions_api_client.cc',
105         'browser/shell_extensions_api_client.h',
106         'browser/shell_extensions_browser_client.cc',
107         'browser/shell_extensions_browser_client.h',
108         'browser/shell_native_app_window.cc',
109         'browser/shell_native_app_window.h',
110         'browser/shell_native_app_window_mac.h',
111         'browser/shell_native_app_window_mac.mm',
112         'browser/shell_network_controller_chromeos.cc',
113         'browser/shell_network_controller_chromeos.h',
114         'browser/shell_network_delegate.cc',
115         'browser/shell_network_delegate.h',
116         'browser/shell_oauth2_token_service.cc',
117         'browser/shell_oauth2_token_service.h',
118         'browser/shell_prefs.cc',
119         'browser/shell_prefs.h',
120         'browser/shell_runtime_api_delegate.cc',
121         'browser/shell_runtime_api_delegate.h',
122         'browser/shell_special_storage_policy.cc',
123         'browser/shell_special_storage_policy.h',
124         'browser/shell_speech_recognition_manager_delegate.cc',
125         'browser/shell_speech_recognition_manager_delegate.h',
126         'browser/shell_update_query_params_delegate.cc',
127         'browser/shell_update_query_params_delegate.h',
128         'browser/shell_url_request_context_getter.cc',
129         'browser/shell_url_request_context_getter.h',
130         'browser/shell_web_contents_modal_dialog_manager.cc',
131         'common/shell_content_client.cc',
132         'common/shell_content_client.h',
133         'common/shell_extensions_client.cc',
134         'common/shell_extensions_client.h',
135         'common/switches.cc',
136         'common/switches.h',
137         'renderer/shell_content_renderer_client.cc',
138         'renderer/shell_content_renderer_client.h',
139         'renderer/shell_extensions_renderer_client.cc',
140         'renderer/shell_extensions_renderer_client.h',
141         'utility/shell_content_utility_client.cc',
142         'utility/shell_content_utility_client.h',
143       ],
144       'conditions': [
145         ['use_aura==1', {
146           'dependencies': [
147             '<(DEPTH)/ui/wm/wm.gyp:wm',
148           ],
149           'sources': [
150             'browser/shell_app_window_client_aura.cc',
151             'browser/shell_desktop_controller_aura.cc',
152             'browser/shell_desktop_controller_aura.h',
153             'browser/shell_native_app_window_aura.cc',
154             'browser/shell_native_app_window_aura.h',
155             'browser/shell_screen.cc',
156             'browser/shell_screen.h',
157           ],
158         }],
159         ['chromeos==1', {
160           'dependencies': [
161             '<(DEPTH)/chromeos/chromeos.gyp:chromeos',
162             '<(DEPTH)/ui/chromeos/ui_chromeos.gyp:ui_chromeos',
163             '<(DEPTH)/ui/display/display.gyp:display',
164           ],
165           'sources': [
166             'browser/api/shell_gcd/shell_gcd_api.cc',
167             'browser/api/shell_gcd/shell_gcd_api.h',
168             'browser/api/vpn_provider/vpn_service_factory.cc',
169           ],
170         }],
171         ['disable_nacl==0 and OS=="linux"', {
172           'dependencies': [
173             '<(DEPTH)/components/nacl.gyp:nacl_helper',
174           ],
175         }],
176         ['disable_nacl==0', {
177           'dependencies': [
178             '<(DEPTH)/components/nacl.gyp:nacl',
179             '<(DEPTH)/components/nacl.gyp:nacl_browser',
180             '<(DEPTH)/components/nacl.gyp:nacl_common',
181             '<(DEPTH)/components/nacl.gyp:nacl_renderer',
182             '<(DEPTH)/components/nacl.gyp:nacl_switches',
183           ],
184           'sources': [
185             'browser/shell_nacl_browser_delegate.cc',
186             'browser/shell_nacl_browser_delegate.h',
187           ],
188         }],
189       ],
190     },
191     {
192       'target_name': 'app_shell',
193       'type': 'executable',
194       'mac_bundle': 1,
195       'dependencies': [
196         'app_shell_lib',
197         '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
198       ],
199       'include_dirs': [
200         '../..',
201       ],
202       'sources': [
203         'app/shell_main.cc',
204       ],
205       'conditions': [
206         ['OS=="win"', {
207           'msvs_settings': {
208             'VCLinkerTool': {
209               'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
210             },
211           },
212           'dependencies': [
213             '<(DEPTH)/sandbox/sandbox.gyp:sandbox',
214           ],
215         }],
216         ['OS=="win" and win_use_allocator_shim==1', {
217           'dependencies': [
218             '<(DEPTH)/base/allocator/allocator.gyp:allocator',
219           ],
220         }],
221         ['OS=="mac"', {
222           'product_name': '<(app_shell_product_name)',
223           'dependencies!': [
224             'app_shell_lib',
225           ],
226           'dependencies': [
227             'app_shell_framework',
228             'app_shell_helper',
229           ],
230           'mac_bundle_resources': [
231             'app/app-Info.plist',
232           ],
233           # TODO(mark): Come up with a fancier way to do this.  It should only
234           # be necessary to list app-Info.plist once, not the three times it is
235           # listed here.
236           'mac_bundle_resources!': [
237             'app/app-Info.plist',
238           ],
239           'xcode_settings': {
240             'INFOPLIST_FILE': 'app/app-Info.plist',
241           },
242           'copies': [{
243               'destination': '<(PRODUCT_DIR)/<(app_shell_product_name).app/Contents/Frameworks',
244               'files': [
245                 '<(PRODUCT_DIR)/<(app_shell_product_name) Helper.app',
246               ],
247           }],
248           'postbuilds': [
249             {
250               'postbuild_name': 'Copy <(app_shell_product_name) Framework.framework',
251               'action': [
252                 '../../build/mac/copy_framework_unversioned.sh',
253                 '${BUILT_PRODUCTS_DIR}/<(app_shell_product_name) Framework.framework',
254                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
255               ],
256             },
257             {
258               # Modify the Info.plist as needed.
259               'postbuild_name': 'Tweak Info.plist',
260               'action': ['../../build/mac/tweak_info_plist.py',
261                          '--scm=1',
262                          '--version=<(app_shell_version)'],
263             },
264             {
265               # This postbuild step is responsible for creating the following
266               # helpers:
267               #
268               # App Shell Helper EH.app and App Shell Helper NP.app are
269               # created from App Shell Helper.app.
270               #
271               # The EH helper is marked for an executable heap. The NP helper
272               # is marked for no PIE (ASLR).
273               'postbuild_name': 'Make More Helpers',
274               'action': [
275                 '../../build/mac/make_more_helpers.sh',
276                 'Frameworks',
277                 '<(app_shell_product_name)',
278               ],
279             },
280             {
281               # Make sure there isn't any Objective-C in the shell's
282               # executable.
283               'postbuild_name': 'Verify No Objective-C',
284               'action': [
285                 '../../build/mac/verify_no_objc.sh',
286               ],
287             },
288           ],
289         }],
290       ],
291     },
292     {
293       'target_name': 'app_shell_unittests',
294       'type': 'executable',
295       'dependencies': [
296         'app_shell_lib',
297         '<(DEPTH)/base/base.gyp:base',
298         '<(DEPTH)/base/base.gyp:test_support_base',
299         '<(DEPTH)/content/content.gyp:content_app_both',
300         '<(DEPTH)/content/content_shell_and_tests.gyp:test_support_content',
301         '<(DEPTH)/extensions/extensions.gyp:extensions_shell_and_test_pak',
302         '<(DEPTH)/extensions/extensions.gyp:extensions_test_support',
303         '<(DEPTH)/testing/gtest.gyp:gtest',
304       ],
305       'sources': [
306         '../test/extensions_unittests_main.cc',
307         'browser/api/identity/identity_api_unittest.cc',
308         'browser/shell_oauth2_token_service_unittest.cc',
309         'browser/shell_prefs_unittest.cc',
310         'common/shell_content_client_unittest.cc'
311       ],
312       'conditions': [
313         ['disable_nacl==0', {
314           'sources': [
315             'browser/shell_nacl_browser_delegate_unittest.cc',
316           ],
317         }],
318         ['use_aura==1', {
319           'sources': [
320             'browser/shell_desktop_controller_aura_unittest.cc',
321             'browser/shell_native_app_window_aura_unittest.cc',
322             'browser/shell_screen_unittest.cc',
323           ],
324           'dependencies': [
325             '<(DEPTH)/ui/aura/aura.gyp:aura_test_support',
326           ],
327         }],
328         ['chromeos==1', {
329           'dependencies': [
330             '<(DEPTH)/chromeos/chromeos.gyp:chromeos_test_support_without_gmock',
331           ],
332           'sources': [
333             'browser/api/shell_gcd/shell_gcd_api_unittest.cc',
334             'browser/shell_audio_controller_chromeos_unittest.cc',
335           ],
336         }],
337         ['OS=="win" and win_use_allocator_shim==1', {
338           'dependencies': [
339             '<(DEPTH)/base/allocator/allocator.gyp:allocator',
340           ],
341         }],
342       ],
343     },
344     {
345       'target_name': 'app_shell_version_header',
346       'type': 'none',
347       'direct_dependent_settings': {
348         'include_dirs': [
349           '<(SHARED_INTERMEDIATE_DIR)',
350         ],
351       },
352       'actions': [
353         {
354           'action_name': 'version_header',
355           'message': 'Generating version header file: <@(_outputs)',
356           'variables': {
357             'lastchange_path': '<(DEPTH)/build/util/LASTCHANGE',
358           },
359           'inputs': [
360             '<(version_path)',
361             '<(lastchange_path)',
362             'common/version.h.in',
363           ],
364           'outputs': [
365             '<(SHARED_INTERMEDIATE_DIR)/extensions/shell/common/version.h',
366           ],
367           'action': [
368             'python',
369             '<(version_py_path)',
370             '-f', '<(lastchange_path)',
371             '-f', '<(version_path)',
372             'common/version.h.in',
373             '<@(_outputs)',
374           ],
375           'includes': [
376             '../../build/util/version.gypi',
377           ],
378         },
379       ],
380     },
381   ],  # targets
383   'conditions': [
384     ['OS=="mac"', {
385       'targets': [
386         {
387           'target_name': 'app_shell_framework',
388           'type': 'shared_library',
389           'product_name': '<(app_shell_product_name) Framework',
390           'mac_bundle': 1,
391           'mac_bundle_resources': [
392             '<(PRODUCT_DIR)/extensions_shell_and_test.pak',
393             'app/framework-Info.plist',
394           ],
395           'mac_bundle_resources!': [
396             'app/framework-Info.plist',
397           ],
398           'xcode_settings': {
399             # The framework is placed within the .app's Framework
400             # directory.  DYLIB_INSTALL_NAME_BASE and
401             # LD_DYLIB_INSTALL_NAME affect -install_name.
402             'DYLIB_INSTALL_NAME_BASE':
403                 '@executable_path/../Frameworks',
404             # See /build/mac/copy_framework_unversioned.sh for
405             # information on LD_DYLIB_INSTALL_NAME.
406             'LD_DYLIB_INSTALL_NAME':
407                 '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)',
409             'INFOPLIST_FILE': 'app/framework-Info.plist',
410           },
411           'dependencies': [
412             'app_shell_lib',
413           ],
414           'include_dirs': [
415             '../..',
416           ],
417           'sources': [
418             'app/shell_main_mac.h',
419             'app/shell_main_mac.cc',
420           ],
421           'postbuilds': [
422             {
423               # Modify the Info.plist as needed.  The script explains why
424               # this is needed.  This is also done in the chrome target.
425               # The framework needs the Breakpad keys if this feature is
426               # enabled.  It does not need the Keystone keys; these always
427               # come from the outer application bundle.  The framework
428               # doesn't currently use the SCM keys for anything,
429               # but this seems like a really good place to store them.
430               'postbuild_name': 'Tweak Info.plist',
431               'action': ['../../build/mac/tweak_info_plist.py',
432                          '--breakpad=1',
433                          '--keystone=0',
434                          '--scm=1',
435                          '--version=<(app_shell_version)',
436                          '--branding=<(app_shell_product_name)'],
437             },
438           ],
439           'conditions': [
440             ['icu_use_data_file_flag==1', {
441               'mac_bundle_resources': [
442                 '<(PRODUCT_DIR)/icudtl.dat',
443               ],
444             }],
445             ['v8_use_external_startup_data==1', {
446               'mac_bundle_resources': [
447                 '<(PRODUCT_DIR)/natives_blob.bin',
448                 '<(PRODUCT_DIR)/snapshot_blob.bin',
449               ],
450             }],
451           ],
452         },  # target app_shell_framework
453         {
454           'target_name': 'app_shell_helper',
455           'type': 'executable',
456           'variables': { 'enable_wexit_time_destructors': 1, },
457           'product_name': '<(app_shell_product_name) Helper',
458           'mac_bundle': 1,
459           'dependencies': [
460             'app_shell_framework',
461           ],
462           'sources': [
463             'app/shell_main.cc',
464             'app/helper-Info.plist',
465           ],
466           # TODO(mark): Come up with a fancier way to do this.  It should only
467           # be necessary to list helper-Info.plist once, not the three times it
468           # is listed here.
469           'mac_bundle_resources!': [
470             'app/helper-Info.plist',
471           ],
472           # TODO(mark): For now, don't put any resources into this app.  Its
473           # resources directory will be a symbolic link to the browser app's
474           # resources directory.
475           'mac_bundle_resources/': [
476             ['exclude', '.*'],
477           ],
478           'xcode_settings': {
479             'INFOPLIST_FILE': 'app/helper-Info.plist',
480           },
481           'postbuilds': [
482             {
483               # The framework defines its load-time path
484               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
485               # (chrome).  A different relative path needs to be used in
486               # helper_app.
487               'postbuild_name': 'Fix Framework Link',
488               'action': [
489                 'install_name_tool',
490                 '-change',
491                 '@executable_path/../Frameworks/<(app_shell_product_name) Framework.framework/<(app_shell_product_name) Framework',
492                 '@executable_path/../../../<(app_shell_product_name) Framework.framework/<(app_shell_product_name) Framework',
493                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
494               ],
495             },
496             {
497               # Modify the Info.plist as needed.  The script explains why this
498               # is needed.  This is also done in the chrome and chrome_dll
499               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
500               # are used because Breakpad, Keystone, and SCM keys are
501               # never placed into the helper.
502               'postbuild_name': 'Tweak Info.plist',
503               'action': ['../../build/mac/tweak_info_plist.py',
504                          '--breakpad=0',
505                          '--keystone=0',
506                          '--scm=0',
507                          '--version=<(app_shell_version)'],
508             },
509             {
510               # Make sure there isn't any Objective-C in the helper app's
511               # executable.
512               'postbuild_name': 'Verify No Objective-C',
513               'action': [
514                 '../../build/mac/verify_no_objc.sh',
515               ],
516             },
517           ],
518         },  # target app_shell_helper
519       ],
520     }],  # OS=="mac"
521   ],