[Android] Lint build/android/gyp/.
[chromium-blink-merge.git] / content / content_shell.gypi
blob9290d4934979eaa4a4572a8b608e497e08d76310
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.
6   'variables': {
7     'content_shell_product_name': 'Content Shell',
8     # The "19" is so that sites that sniff for version think that this is
9     # something reasonably current; the "77.34.5" is a hint that this isn't a
10     # standard Chrome.
11     'content_shell_version': '19.77.34.5',
12     'conditions': [
13       ['OS=="linux"', {
14        'use_custom_freetype%': 1,
15       }, {
16        'use_custom_freetype%': 0,
17       }],
18     ],
19   },
20   'targets': [
21     {
22       'target_name': 'content_shell_lib',
23       'type': 'static_library',
24       'defines': ['CONTENT_SHELL_VERSION="<(content_shell_version)"'],
25       'variables': {
26         'chromium_code': 1,
27       },
28       'dependencies': [
29         'content.gyp:content_app_both',
30         'content.gyp:content_browser',
31         'content.gyp:content_common',
32         'content.gyp:content_gpu',
33         'content.gyp:content_plugin',
34         'content.gyp:content_ppapi_plugin',
35         'content.gyp:content_renderer',
36         'content.gyp:content_utility',
37         'content.gyp:content_worker',
38         'content_resources.gyp:content_resources',
39         'content_shell_resources',
40         'copy_test_netscape_plugin',
41         'test_support_content',
42         '../base/base.gyp:base',
43         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
44         '../components/components.gyp:breakpad_component',
45         '../gin/gin.gyp:gin',
46         '../ipc/ipc.gyp:ipc',
47         '../media/media.gyp:media',
48         '../net/net.gyp:net',
49         '../net/net.gyp:net_resources',
50         '../skia/skia.gyp:skia',
51         '../third_party/WebKit/public/blink.gyp:blink',
52         '../third_party/WebKit/public/blink.gyp:blink_web_test_support',
53         '../ui/base/ui_base.gyp:ui_base',
54         '../ui/events/events.gyp:events_base',
55         '../ui/gfx/gfx.gyp:gfx',
56         '../ui/gfx/gfx.gyp:gfx_geometry',
57         '../ui/gl/gl.gyp:gl',
58         '../url/url.gyp:url_lib',
59         '../v8/tools/gyp/v8.gyp:v8',
60         '../webkit/common/webkit_common.gyp:webkit_common',
61         '../webkit/webkit_resources.gyp:webkit_resources',
62       ],
63       'include_dirs': [
64         '..',
65       ],
66       'sources': [
67         'public/test/layouttest_support.h',
68         'shell/android/shell_jni_registrar.cc',
69         'shell/android/shell_jni_registrar.h',
70         'shell/android/shell_manager.cc',
71         'shell/android/shell_manager.h',
72         'shell/app/paths_mac.h',
73         'shell/app/paths_mac.mm',
74         'shell/app/shell_breakpad_client.cc',
75         'shell/app/shell_breakpad_client.h',
76         'shell/app/shell_main_delegate.cc',
77         'shell/app/shell_main_delegate.h',
78         'shell/app/shell_main_delegate_mac.h',
79         'shell/app/shell_main_delegate_mac.mm',
80         'shell/app/webkit_test_platform_support_android.cc',
81         'shell/app/webkit_test_platform_support.h',
82         'shell/app/webkit_test_platform_support_linux.cc',
83         'shell/app/webkit_test_platform_support_mac.mm',
84         'shell/app/webkit_test_platform_support_win.cc',
85         'shell/browser/notify_done_forwarder.cc',
86         'shell/browser/notify_done_forwarder.h',
87         'shell/browser/shell_android.cc',
88         'shell/browser/shell_application_mac.h',
89         'shell/browser/shell_application_mac.mm',
90         'shell/browser/shell_aura.cc',
91         'shell/browser/shell_browser_context.cc',
92         'shell/browser/shell_browser_context.h',
93         'shell/browser/shell_browser_main.cc',
94         'shell/browser/shell_browser_main.h',
95         'shell/browser/shell_browser_main_parts.cc',
96         'shell/browser/shell_browser_main_parts.h',
97         'shell/browser/shell_browser_main_parts_mac.mm',
98         'shell/browser/shell.cc',
99         'shell/browser/shell_content_browser_client.cc',
100         'shell/browser/shell_content_browser_client.h',
101         'shell/browser/shell_devtools_delegate.cc',
102         'shell/browser/shell_devtools_delegate.h',
103         'shell/browser/shell_devtools_frontend.cc',
104         'shell/browser/shell_devtools_frontend.h',
105         'shell/browser/shell_download_manager_delegate.cc',
106         'shell/browser/shell_download_manager_delegate.h',
107         'shell/browser/shell_gtk.cc',
108         'shell/browser/shell.h',
109         'shell/browser/shell_javascript_dialog_gtk.cc',
110         'shell/browser/shell_javascript_dialog.h',
111         'shell/browser/shell_javascript_dialog_mac.mm',
112         'shell/browser/shell_javascript_dialog_manager.cc',
113         'shell/browser/shell_javascript_dialog_manager.h',
114         'shell/browser/shell_javascript_dialog_win.cc',
115         'shell/browser/shell_layout_tests_android.cc',
116         'shell/browser/shell_layout_tests_android.h',
117         'shell/browser/shell_login_dialog.cc',
118         'shell/browser/shell_login_dialog_gtk.cc',
119         'shell/browser/shell_login_dialog.h',
120         'shell/browser/shell_login_dialog_mac.mm',
121         'shell/browser/shell_mac.mm',
122         'shell/browser/shell_message_filter.cc',
123         'shell/browser/shell_message_filter.h',
124         'shell/browser/shell_net_log.cc',
125         'shell/browser/shell_net_log.h',
126         'shell/browser/shell_network_delegate.cc',
127         'shell/browser/shell_network_delegate.h',
128         'shell/browser/shell_platform_data_aura.cc',
129         'shell/browser/shell_platform_data_aura.h',
130         'shell/browser/shell_plugin_service_filter.cc',
131         'shell/browser/shell_plugin_service_filter.h',
132         'shell/browser/shell_quota_permission_context.cc',
133         'shell/browser/shell_quota_permission_context.h',
134         'shell/browser/shell_resource_dispatcher_host_delegate.cc',
135         'shell/browser/shell_resource_dispatcher_host_delegate.h',
136         'shell/browser/shell_speech_recognition_manager_delegate.cc',
137         'shell/browser/shell_speech_recognition_manager_delegate.h',
138         'shell/browser/shell_url_request_context_getter.cc',
139         'shell/browser/shell_url_request_context_getter.h',
140         'shell/browser/shell_views.cc',
141         'shell/browser/shell_web_contents_view_delegate_android.cc',
142         'shell/browser/shell_web_contents_view_delegate_creator.h',
143         'shell/browser/shell_web_contents_view_delegate_gtk.cc',
144         'shell/browser/shell_web_contents_view_delegate.h',
145         'shell/browser/shell_web_contents_view_delegate_mac.mm',
146         'shell/browser/shell_web_contents_view_delegate_win.cc',
147         'shell/browser/webkit_test_controller.cc',
148         'shell/browser/webkit_test_controller.h',
149         'shell/common/leak_detection_result.h',
150         'shell/common/shell_content_client.cc',
151         'shell/common/shell_content_client.h',
152         'shell/common/shell_messages.cc',
153         'shell/common/shell_messages.h',
154         'shell/common/shell_switches.cc',
155         'shell/common/shell_switches.h',
156         'shell/common/shell_test_configuration.cc',
157         'shell/common/shell_test_configuration.h',
158         'shell/common/test_runner/WebPreferences.cpp',
159         'shell/common/test_runner/WebPreferences.h',
160         'shell/common/webkit_test_helpers.cc',
161         'shell/common/webkit_test_helpers.h',
162         'shell/geolocation/shell_access_token_store.cc',
163         'shell/geolocation/shell_access_token_store.h',
164         'shell/renderer/gc_controller.cc',
165         'shell/renderer/gc_controller.h',
166         'shell/renderer/leak_detector.cc',
167         'shell/renderer/leak_detector.h',
168         'shell/renderer/shell_content_renderer_client.cc',
169         'shell/renderer/shell_content_renderer_client.h',
170         'shell/renderer/shell_render_frame_observer.cc',
171         'shell/renderer/shell_render_frame_observer.h',
172         'shell/renderer/shell_render_process_observer.cc',
173         'shell/renderer/shell_render_process_observer.h',
174         'shell/renderer/shell_render_view_observer.cc',
175         'shell/renderer/shell_render_view_observer.h',
176         'shell/renderer/test_runner/CppBoundClass.cpp',
177         'shell/renderer/test_runner/CppBoundClass.h',
178         'shell/renderer/test_runner/CppVariant.cpp',
179         'shell/renderer/test_runner/CppVariant.h',
180         'shell/renderer/test_runner/EventSender.cpp',
181         'shell/renderer/test_runner/EventSender.h',
182         'shell/renderer/test_runner/KeyCodeMapping.cpp',
183         'shell/renderer/test_runner/KeyCodeMapping.h',
184         'shell/renderer/test_runner/MockColorChooser.cpp',
185         'shell/renderer/test_runner/MockColorChooser.h',
186         'shell/renderer/test_runner/MockConstraints.cpp',
187         'shell/renderer/test_runner/MockConstraints.h',
188         'shell/renderer/test_runner/MockGrammarCheck.cpp',
189         'shell/renderer/test_runner/MockGrammarCheck.h',
190         'shell/renderer/test_runner/MockSpellCheck.cpp',
191         'shell/renderer/test_runner/MockSpellCheck.h',
192         'shell/renderer/test_runner/MockWebAudioDevice.cpp',
193         'shell/renderer/test_runner/MockWebAudioDevice.h',
194         'shell/renderer/test_runner/MockWebMIDIAccessor.cpp',
195         'shell/renderer/test_runner/MockWebMIDIAccessor.h',
196         'shell/renderer/test_runner/MockWebMediaStreamCenter.cpp',
197         'shell/renderer/test_runner/MockWebMediaStreamCenter.h',
198         'shell/renderer/test_runner/MockWebRTCDTMFSenderHandler.cpp',
199         'shell/renderer/test_runner/MockWebRTCDTMFSenderHandler.h',
200         'shell/renderer/test_runner/MockWebRTCDataChannelHandler.cpp',
201         'shell/renderer/test_runner/MockWebRTCDataChannelHandler.h',
202         'shell/renderer/test_runner/MockWebRTCPeerConnectionHandler.cpp',
203         'shell/renderer/test_runner/MockWebRTCPeerConnectionHandler.h',
204         'shell/renderer/test_runner/MockWebSpeechInputController.cpp',
205         'shell/renderer/test_runner/MockWebSpeechInputController.h',
206         'shell/renderer/test_runner/MockWebSpeechRecognizer.cpp',
207         'shell/renderer/test_runner/MockWebSpeechRecognizer.h',
208         'shell/renderer/test_runner/SpellCheckClient.cpp',
209         'shell/renderer/test_runner/SpellCheckClient.h',
210         'shell/renderer/test_runner/TestCommon.cpp',
211         'shell/renderer/test_runner/TestCommon.h',
212         'shell/renderer/test_runner/TestInterfaces.cpp',
213         'shell/renderer/test_runner/TestInterfaces.h',
214         'shell/renderer/test_runner/TestPlugin.cpp',
215         'shell/renderer/test_runner/TestPlugin.h',
216         'shell/renderer/test_runner/WebFrameTestProxy.h',
217         'shell/renderer/test_runner/WebPermissions.cpp',
218         'shell/renderer/test_runner/WebPermissions.h',
219         'shell/renderer/test_runner/WebTask.cpp',
220         'shell/renderer/test_runner/WebTask.h',
221         'shell/renderer/test_runner/WebTestDelegate.h',
222         'shell/renderer/test_runner/WebTestInterfaces.cpp',
223         'shell/renderer/test_runner/WebTestInterfaces.h',
224         'shell/renderer/test_runner/WebTestProxy.cpp',
225         'shell/renderer/test_runner/WebTestProxy.h',
226         'shell/renderer/test_runner/WebTestRunner.h',
227         'shell/renderer/test_runner/WebTestThemeEngineMac.h',
228         'shell/renderer/test_runner/WebTestThemeEngineMac.mm',
229         'shell/renderer/test_runner/WebTestThemeEngineMock.cpp',
230         'shell/renderer/test_runner/WebTestThemeEngineMock.h',
231         'shell/renderer/test_runner/WebUserMediaClientMock.cpp',
232         'shell/renderer/test_runner/WebUserMediaClientMock.h',
233         'shell/renderer/test_runner/accessibility_controller.cc',
234         'shell/renderer/test_runner/accessibility_controller.h',
235         'shell/renderer/test_runner/gamepad_controller.cc',
236         'shell/renderer/test_runner/gamepad_controller.h',
237         'shell/renderer/test_runner/notification_presenter.cc',
238         'shell/renderer/test_runner/notification_presenter.h',
239         'shell/renderer/test_runner/test_runner.cc',
240         'shell/renderer/test_runner/test_runner.h',
241         'shell/renderer/test_runner/text_input_controller.cc',
242         'shell/renderer/test_runner/text_input_controller.h',
243         'shell/renderer/test_runner/unsafe_persistent.h',
244         'shell/renderer/test_runner/web_ax_object_proxy.cc',
245         'shell/renderer/test_runner/web_ax_object_proxy.h',
246         'shell/renderer/webkit_test_runner.cc',
247         'shell/renderer/webkit_test_runner.h',
248         'test/layouttest_support.cc',
249       ],
250       'msvs_settings': {
251         'VCLinkerTool': {
252           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
253         },
254       },
255       'conditions': [
256         ['OS=="mac"', {
257           'sources/': [
258             ['exclude', 'WebTestThemeEngineMock.cpp'],
259           ],
260         }],
261         ['OS=="win" and win_use_allocator_shim==1', {
262           'dependencies': [
263             '../base/allocator/allocator.gyp:allocator',
264           ],
265         }],
266         ['OS=="win"', {
267           'resource_include_dirs': [
268             '<(SHARED_INTERMEDIATE_DIR)/webkit',
269           ],
270           'dependencies': [
271             '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
272           ],
273           'configurations': {
274             'Debug_Base': {
275               'msvs_settings': {
276                 'VCLinkerTool': {
277                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
278                 },
279               },
280             },
281           },
282           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
283           'msvs_disabled_warnings': [ 4267, ],
284         }, {  # OS!="win"
285           'sources/': [
286             ['exclude', 'Win\\.cpp$'],
287           ],
288         }],  # OS=="win"
289         ['OS=="linux"', {
290           'dependencies': [
291             '../build/linux/system.gyp:fontconfig',
292           ],
293         }],
294         ['use_x11 == 1', {
295           'dependencies': [
296             '../tools/xdisplaycheck/xdisplaycheck.gyp:xdisplaycheck',
297           ],
298         }],
299         ['OS=="android"', {
300           'dependencies': [
301             'content_shell_jni_headers',
302           ],
303           'dependencies!': [
304             'copy_test_netscape_plugin',
305           ],
306         }, {  # else: OS!="android"
307           'dependencies': [
308             # This dependency is for running DRT against the content shell, and
309             # this combination is not yet supported on Android.
310             'test_support_content',
311           ],
312         }],  # OS=="android"
313         ['os_posix == 1 and OS != "mac" and android_webview_build != 1', {
314           'dependencies': [
315             '../components/components.gyp:breakpad_host',
316           ],
317         }],
318         # TODO(dmikurube): Kill linux_use_tcmalloc. http://crbug.com/345554
319         ['(os_posix==1 and use_aura==1 and ((use_allocator!="none" and use_allocator!="see_use_tcmalloc") or (use_allocator=="see_use_tcmalloc" and linux_use_tcmalloc==1))) or (android_use_tcmalloc==1)', {
320           'dependencies': [
321             # This is needed by content/app/content_main_runner.cc
322             '../base/allocator/allocator.gyp:allocator',
323           ],
324         }],
325         ['use_aura==1', {
326           'dependencies': [
327             '../ui/aura/aura.gyp:aura',
328             '../ui/base/strings/ui_strings.gyp:ui_strings',
329           ],
330           'sources/': [
331             ['exclude', 'shell/browser/shell_gtk.cc'],
332           ],
333           'conditions': [
334             ['toolkit_views==1', {
335               'dependencies': [
336                 '../ui/resources/ui_resources.gyp:ui_resources',
337                 '../ui/views/controls/webview/webview.gyp:webview',
338                 '../ui/views/views.gyp:views',
339                 '../ui/views/views.gyp:views_test_support',
340                 '../ui/wm/wm.gyp:wm_core',
341               ],
342               'sources/': [
343                 ['exclude', 'shell/browser/shell_aura.cc'],
344               ],
345             }, {
346               'sources/': [
347                 ['exclude', 'shell/browser/shell_views.cc'],
348               ],
349             }],
350           ],
351         }, {
352           'sources/': [
353             ['exclude', 'shell/browser/shell_aura.cc'],
354             ['exclude', 'shell/browser/shell_views.cc'],
355           ],
356         }],  # use_aura==1
357         # The test plugin relies on X11.
358         ['OS=="linux" and use_x11==0', {
359           'dependencies!': [
360             'copy_test_netscape_plugin',
361           ],
362         }],
363         ['chromeos==1', {
364           'dependencies': [
365             '../chromeos/chromeos.gyp:chromeos',
366             '../ui/wm/wm.gyp:wm_test_support',
367            ],
368         }], # chromeos==1
369         ['use_custom_freetype==1', {
370           'dependencies': [
371              '../third_party/freetype2/freetype2.gyp:freetype2',
372           ],
373         }],
374         ['enable_plugins==0', {
375           'sources/': [
376             ['exclude', 'shell/browser/shell_plugin_service_filter.cc'],
377             ['exclude', 'shell/browser/shell_plugin_service_filter.h'],
378           ],
379         }]
380       ],
381     },
382     {
383       'target_name': 'content_shell_resources',
384       'type': 'none',
385       'dependencies': [
386         'generate_content_shell_resources',
387       ],
388       'variables': {
389         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content',
390       },
391       'includes': [ '../build/grit_target.gypi' ],
392       'copies': [
393         {
394           'destination': '<(PRODUCT_DIR)',
395           'files': [
396             '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak'
397           ],
398         },
399       ],
400       'conditions': [
401         ['OS=="win"', {
402           'copies': [{
403             'destination': '<(PRODUCT_DIR)',
404             'files': ['shell/renderer/test_runner/resources/fonts/AHEM____.TTF'],
405           }],
406         }],
407         ['OS=="mac"', {
408           'all_dependent_settings': {
409             'mac_bundle_resources': [
410               'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
411               'shell/renderer/test_runner/resources/fonts/ChromiumAATTest.ttf',
412               '<(SHARED_INTERMEDIATE_DIR)/webkit/missingImage.png',
413               '<(SHARED_INTERMEDIATE_DIR)/webkit/textAreaResizeCorner.png',
414             ],
415           },
416         }],
417         ['use_x11 == 1', {
418           'copies': [{
419             'destination': '<(PRODUCT_DIR)',
420             'files': [
421               'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
422               'shell/renderer/test_runner/resources/fonts/fonts.conf',
423             ]
424           }],
425         }],
426         ['OS=="android"', {
427           'copies': [{
428             'destination': '<(PRODUCT_DIR)',
429             'files': [
430               'shell/renderer/test_runner/resources/fonts/AHEM____.TTF',
431               'shell/renderer/test_runner/resources/fonts/android_main_fonts.xml',
432               'shell/renderer/test_runner/resources/fonts/android_fallback_fonts.xml',
433             ]
434           }],
435         }],
436       ],
437     },
438     {
439       'target_name': 'generate_content_shell_resources',
440       'type': 'none',
441       'variables': {
442         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/content',
443       },
444       'actions': [
445         {
446           'action_name': 'content_shell_resources',
447           'variables': {
448             'grit_grd_file': 'shell/shell_resources.grd',
449           },
450           'includes': [ '../build/grit_action.gypi' ],
451         },
452       ],
453     },
454     {
455       # We build a minimal set of resources so WebKit in content_shell has
456       # access to necessary resources.
457       'target_name': 'content_shell_pak',
458       'type': 'none',
459       'dependencies': [
460         'content_resources.gyp:content_resources',
461         'content_shell_resources',
462         '<(DEPTH)/net/net.gyp:net_resources',
463         '<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings',
464         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
465         '<(DEPTH)/webkit/webkit_resources.gyp:webkit_resources',
466         '<(DEPTH)/webkit/webkit_resources.gyp:webkit_strings',
467       ],
468       'conditions': [
469         ['OS!="android" and OS!="ios"', {
470           'dependencies': [
471             'browser/tracing/tracing_resources.gyp:tracing_resources',
472           ],
473         }],
474         ['OS!="android"', {
475           'dependencies': [
476             'browser/devtools/devtools_resources.gyp:devtools_resources',
477           ],
478         }],
479       ],
480       'variables': {
481         'repack_path': '<(DEPTH)/tools/grit/grit/format/repack.py',
482       },
483       'actions': [
484         {
485           'action_name': 'repack_content_shell_pack',
486           'variables': {
487             'pak_inputs': [
488               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
489               '<(SHARED_INTERMEDIATE_DIR)/content/browser/tracing/tracing_resources.pak',
490               '<(SHARED_INTERMEDIATE_DIR)/content/shell_resources.pak',
491               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
492               '<(SHARED_INTERMEDIATE_DIR)/ui/app_locale_settings/app_locale_settings_en-US.pak',
493               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
494               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/webui_resources.pak',
495               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/ui_strings_en-US.pak',
496               '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
497               '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
498               '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
499             ],
500           },
501           'inputs': [
502             '<(repack_path)',
503             '<@(pak_inputs)',
504           ],
505           'action': ['python', '<(repack_path)', '<@(_outputs)',
506                      '<@(pak_inputs)'],
507           'conditions': [
508             ['OS!="android"', {
509               'variables': {
510                 'pak_inputs': [
511                   '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
512                 ],
513               },
514               'outputs': [
515                 '<(PRODUCT_DIR)/content_shell.pak',
516               ],
517             }, {
518               'outputs': [
519                 '<(PRODUCT_DIR)/content_shell/assets/content_shell.pak',
520               ],
521             }],
522           ],
523         },
524       ],
525     },
526     {
527       'target_name': 'content_shell',
528       'type': 'executable',
529       'mac_bundle': 1,
530       'variables': {
531         'chromium_code': 1,
532       },
533       'dependencies': [
534         'content_shell_lib',
535         'content_shell_pak',
536         '../third_party/mesa/mesa.gyp:osmesa',
537         '../tools/imagediff/image_diff.gyp:image_diff',
538       ],
539       'include_dirs': [
540         '..',
541       ],
542       'sources': [
543         'app/startup_helper_win.cc',
544         'shell/app/shell_main.cc',
545       ],
546       'mac_bundle_resources': [
547         'shell/app/app.icns',
548         'shell/app/app-Info.plist',
549       ],
550       # TODO(mark): Come up with a fancier way to do this.  It should only
551       # be necessary to list app-Info.plist once, not the three times it is
552       # listed here.
553       'mac_bundle_resources!': [
554         'shell/app/app-Info.plist',
555       ],
556       'xcode_settings': {
557         'INFOPLIST_FILE': 'shell/app/app-Info.plist',
558       },
559       'msvs_settings': {
560         'VCLinkerTool': {
561           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
562         },
563         'VCManifestTool': {
564           'AdditionalManifestFiles': [
565             'shell/app/shell.exe.manifest',
566           ],
567         },
568       },
569       'conditions': [
570         ['OS=="win" and win_use_allocator_shim==1', {
571           'dependencies': [
572             '../base/allocator/allocator.gyp:allocator',
573           ],
574         }],
575         ['OS=="win"', {
576           'sources': [
577             'shell/app/shell.rc',
578           ],
579           'configurations': {
580             'Debug_Base': {
581               'msvs_settings': {
582                 'VCLinkerTool': {
583                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
584                 },
585               },
586             },
587           },
588           'msvs_large_pdb': 1,
589         }],  # OS=="win"
590         ['OS == "win" or toolkit_uses_gtk == 1', {
591           'dependencies': [
592             '../sandbox/sandbox.gyp:sandbox',
593           ],
594         }],  # OS=="win" or toolkit_uses_gtk == 1
595         ['toolkit_uses_gtk == 1', {
596           'dependencies': [
597             '<(DEPTH)/build/linux/system.gyp:gtk',
598           ],
599         }],  # toolkit_uses_gtk
600         ['OS=="mac"', {
601           'product_name': '<(content_shell_product_name)',
602           'dependencies!': [
603             'content_shell_lib',
604           ],
605           'dependencies': [
606             'content_shell_framework',
607             'content_shell_helper_app',
608           ],
609           'copies': [
610             {
611               'destination': '<(PRODUCT_DIR)/<(content_shell_product_name).app/Contents/Frameworks',
612               'files': [
613                 '<(PRODUCT_DIR)/<(content_shell_product_name) Helper.app',
614               ],
615             },
616           ],
617           'postbuilds': [
618             {
619               'postbuild_name': 'Copy <(content_shell_product_name) Framework.framework',
620               'action': [
621                 '../build/mac/copy_framework_unversioned.sh',
622                 '${BUILT_PRODUCTS_DIR}/<(content_shell_product_name) Framework.framework',
623                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
624               ],
625             },
626             {
627               # Modify the Info.plist as needed.
628               'postbuild_name': 'Tweak Info.plist',
629               'action': ['../build/mac/tweak_info_plist.py',
630                          '--scm=1',
631                          '--version=<(content_shell_version)'],
632             },
633             {
634               # This postbuid step is responsible for creating the following
635               # helpers:
636               #
637               # Content Shell Helper EH.app and Content Shell Helper NP.app are
638               # created from Content Shell Helper.app.
639               #
640               # The EH helper is marked for an executable heap. The NP helper
641               # is marked for no PIE (ASLR).
642               'postbuild_name': 'Make More Helpers',
643               'action': [
644                 '../build/mac/make_more_helpers.sh',
645                 'Frameworks',
646                 '<(content_shell_product_name)',
647               ],
648             },
649             {
650               # Make sure there isn't any Objective-C in the shell's
651               # executable.
652               'postbuild_name': 'Verify No Objective-C',
653               'action': [
654                 '../build/mac/verify_no_objc.sh',
655               ],
656             },
657           ],
658         }],  # OS=="mac"
659         ['OS=="android"', {
660           'dependencies!': [
661             '../tools/imagediff/image_diff.gyp:image_diff',
662           ],
663         }],  # OS=="android"
664         ['OS=="android" and android_webview_build==0', {
665           'dependencies': [
666             '../tools/imagediff/image_diff.gyp:image_diff#host',
667           ],
668         }],  # OS=="android" and android_webview_build==0
669       ],
670     },
671     {
672       'target_name': 'content_shell_builder',
673       'type': 'none',
674       'dependencies': [
675         'content_shell',
676       ],
677     },
678     {
679       'target_name': 'layout_test_helper',
680       'type': 'executable',
681       'sources': [
682         'shell/renderer/test_runner/helper/layout_test_helper_mac.mm',
683         'shell/renderer/test_runner/helper/layout_test_helper_win.cc',
684       ],
685       'conditions': [
686         ['OS=="mac"', {
687           'link_settings': {
688             'libraries': [
689               '$(SDKROOT)/System/Library/Frameworks/AppKit.framework',
690             ],
691           },
692         }],
693       ],
694     },
695     {
696       'target_name': 'test_netscape_plugin',
697       'type': 'loadable_module',
698       'sources': [
699         'shell/tools/plugin/PluginObject.cpp',
700         'shell/tools/plugin/PluginObject.h',
701         'shell/tools/plugin/PluginObjectMac.mm',
702         'shell/tools/plugin/PluginTest.cpp',
703         'shell/tools/plugin/PluginTest.h',
704         'shell/tools/plugin/TestObject.cpp',
705         'shell/tools/plugin/Tests/DocumentOpenInDestroyStream.cpp',
706         'shell/tools/plugin/Tests/EvaluateJSAfterRemovingPluginElement.cpp',
707         'shell/tools/plugin/Tests/FormValue.cpp',
708         'shell/tools/plugin/Tests/GetURLNotifyWithURLThatFailsToLoad.cpp',
709         'shell/tools/plugin/Tests/GetURLWithJavaScriptURL.cpp',
710         'shell/tools/plugin/Tests/GetURLWithJavaScriptURLDestroyingPlugin.cpp',
711         'shell/tools/plugin/Tests/GetUserAgentWithNullNPPFromNPPNew.cpp',
712         'shell/tools/plugin/Tests/LeakWindowScriptableObject.cpp',
713         'shell/tools/plugin/Tests/LogNPPSetWindow.cpp',
714         'shell/tools/plugin/Tests/NPDeallocateCalledBeforeNPShutdown.cpp',
715         'shell/tools/plugin/Tests/NPPNewFails.cpp',
716         'shell/tools/plugin/Tests/NPRuntimeCallsWithNullNPP.cpp',
717         'shell/tools/plugin/Tests/NPRuntimeObjectFromDestroyedPlugin.cpp',
718         'shell/tools/plugin/Tests/NPRuntimeRemoveProperty.cpp',
719         'shell/tools/plugin/Tests/NullNPPGetValuePointer.cpp',
720         'shell/tools/plugin/Tests/PassDifferentNPPStruct.cpp',
721         'shell/tools/plugin/Tests/PluginScriptableNPObjectInvokeDefault.cpp',
722         'shell/tools/plugin/Tests/PluginScriptableObjectOverridesAllProperties.cpp',
723         'shell/tools/plugin/main.cpp',
724         'shell/tools/plugin/test_object.h',
725       ],
726       'include_dirs': [
727         '<(DEPTH)',
728         '<(DEPTH)/content/shell/tools/plugin/',
729       ],
730       'dependencies': [
731         '../base/base.gyp:base',
732         '../third_party/npapi/npapi.gyp:npapi',
733       ],
734       'conditions': [
735         ['OS=="mac"', {
736           'mac_bundle': 1,
737           'product_extension': 'plugin',
738           'link_settings': {
739             'libraries': [
740               '$(SDKROOT)/System/Library/Frameworks/Carbon.framework',
741               '$(SDKROOT)/System/Library/Frameworks/Cocoa.framework',
742               '$(SDKROOT)/System/Library/Frameworks/QuartzCore.framework',
743             ]
744           },
745           'xcode_settings': {
746             'GCC_SYMBOLS_PRIVATE_EXTERN': 'NO',
747             'INFOPLIST_FILE': 'shell/tools/plugin/mac/Info.plist',
748           },
749         }],
750         ['os_posix == 1 and OS != "mac"', {
751           'cflags': [
752             '-fvisibility=default',
753           ],
754         }],
755         ['OS=="win"', {
756           'defines': [
757             # This seems like a hack, but this is what Safari Win does.
758             'snprintf=_snprintf',
759           ],
760           'sources': [
761             'shell/tools/plugin/win/TestNetscapePlugin.def',
762             'shell/tools/plugin/win/TestNetscapePlugin.rc',
763           ],
764           # The .rc file requires that the name of the dll is np_test_netscape_plugin.dll.
765           'product_name': 'np_test_netscape_plugin',
766           # Disable c4267 warnings until we fix size_t to int truncations.
767           'msvs_disabled_warnings': [ 4267, ],
768         }],
769       ],
770     },
771     {
772       'target_name': 'copy_test_netscape_plugin',
773       'type': 'none',
774       'dependencies': [
775         'test_netscape_plugin',
776       ],
777       'conditions': [
778         ['OS=="win"', {
779           'copies': [{
780             'destination': '<(PRODUCT_DIR)/plugins',
781             'files': ['<(PRODUCT_DIR)/np_test_netscape_plugin.dll'],
782           }],
783         }],
784         ['OS=="mac"', {
785           'copies': [{
786             'destination': '<(PRODUCT_DIR)/plugins/',
787             'files': ['<(PRODUCT_DIR)/test_netscape_plugin.plugin/'],
788           }],
789         }],
790         ['os_posix == 1 and OS != "mac"', {
791           'copies': [{
792             'destination': '<(PRODUCT_DIR)/plugins',
793             'files': ['<(PRODUCT_DIR)/libtest_netscape_plugin.so'],
794           }],
795         }],
796       ],
797     }
798   ],
799   'conditions': [
800     ['OS=="mac"', {
801       'targets': [
802         {
803           'target_name': 'content_shell_framework',
804           'type': 'shared_library',
805           'product_name': '<(content_shell_product_name) Framework',
806           'mac_bundle': 1,
807           'mac_bundle_resources': [
808             'shell/app/English.lproj/HttpAuth.xib',
809             'shell/app/English.lproj/MainMenu.xib',
810             '<(PRODUCT_DIR)/content_shell.pak',
811             'shell/app/framework-Info.plist',
812           ],
813           'mac_bundle_resources!': [
814             'shell/app/framework-Info.plist',
815           ],
816           'xcode_settings': {
817             # The framework is placed within the .app's Framework
818             # directory.  DYLIB_INSTALL_NAME_BASE and
819             # LD_DYLIB_INSTALL_NAME affect -install_name.
820             'DYLIB_INSTALL_NAME_BASE':
821                 '@executable_path/../Frameworks',
822             # See /build/mac/copy_framework_unversioned.sh for
823             # information on LD_DYLIB_INSTALL_NAME.
824             'LD_DYLIB_INSTALL_NAME':
825                 '$(DYLIB_INSTALL_NAME_BASE:standardizepath)/$(WRAPPER_NAME)/$(PRODUCT_NAME)',
827             'INFOPLIST_FILE': 'shell/app/framework-Info.plist',
828           },
829           'dependencies': [
830             'content_shell_lib',
831           ],
832           'include_dirs': [
833             '..',
834           ],
835           'sources': [
836             'shell/app/shell_content_main.cc',
837             'shell/app/shell_content_main.h',
838           ],
839           'postbuilds': [
840             {
841               # Modify the Info.plist as needed.  The script explains why
842               # this is needed.  This is also done in the chrome target.
843               # The framework needs the Breakpad keys if this feature is
844               # enabled.  It does not need the Keystone keys; these always
845               # come from the outer application bundle.  The framework
846               # doesn't currently use the SCM keys for anything,
847               # but this seems like a really good place to store them.
848               'postbuild_name': 'Tweak Info.plist',
849               'action': ['../build/mac/tweak_info_plist.py',
850                          '--breakpad=1',
851                          '--keystone=0',
852                          '--scm=1',
853                          '--version=<(content_shell_version)',
854                          '--branding=<(content_shell_product_name)'],
855             },
856           ],
857           'copies': [
858             {
859               # Copy FFmpeg binaries for audio/video support.
860               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
861               'files': [
862                 '<(PRODUCT_DIR)/ffmpegsumo.so',
863               ],
864             },
865             {
866               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Resources',
867               'files': [
868                 '<(PRODUCT_DIR)/crash_inspector',
869                 '<(PRODUCT_DIR)/crash_report_sender.app'
870               ],
871             },
872           ],
873           'conditions': [
874             ['enable_webrtc==1', {
875               'variables': {
876                 'libpeer_target_type%': 'static_library',
877               },
878               'conditions': [
879                 ['libpeer_target_type!="static_library"', {
880                   'copies': [{
881                    'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
882                    'files': [
883                       '<(PRODUCT_DIR)/libpeerconnection.so',
884                     ],
885                   }],
886                 }],
887               ],
888             }],
889             ['icu_use_data_file_flag==1', {
890               'mac_bundle_resources': [
891                 '<(PRODUCT_DIR)/icudtl.dat',
892               ],
893             }],
894           ],
895         },  # target content_shell_framework
896         {
897           'target_name': 'content_shell_helper_app',
898           'type': 'executable',
899           'variables': { 'enable_wexit_time_destructors': 1, },
900           'product_name': '<(content_shell_product_name) Helper',
901           'mac_bundle': 1,
902           'dependencies': [
903             'content_shell_framework',
904           ],
905           'sources': [
906             'shell/app/shell_main.cc',
907             'shell/app/helper-Info.plist',
908           ],
909           # TODO(mark): Come up with a fancier way to do this.  It should only
910           # be necessary to list helper-Info.plist once, not the three times it
911           # is listed here.
912           'mac_bundle_resources!': [
913             'shell/app/helper-Info.plist',
914           ],
915           # TODO(mark): For now, don't put any resources into this app.  Its
916           # resources directory will be a symbolic link to the browser app's
917           # resources directory.
918           'mac_bundle_resources/': [
919             ['exclude', '.*'],
920           ],
921           'xcode_settings': {
922             'INFOPLIST_FILE': 'shell/app/helper-Info.plist',
923           },
924           'postbuilds': [
925             {
926               # The framework defines its load-time path
927               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
928               # (chrome).  A different relative path needs to be used in
929               # content_shell_helper_app.
930               'postbuild_name': 'Fix Framework Link',
931               'action': [
932                 'install_name_tool',
933                 '-change',
934                 '@executable_path/../Frameworks/<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
935                 '@executable_path/../../../<(content_shell_product_name) Framework.framework/<(content_shell_product_name) Framework',
936                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
937               ],
938             },
939             {
940               # Modify the Info.plist as needed.  The script explains why this
941               # is needed.  This is also done in the chrome and chrome_dll
942               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
943               # are used because Breakpad, Keystone, and SCM keys are
944               # never placed into the helper.
945               'postbuild_name': 'Tweak Info.plist',
946               'action': ['../build/mac/tweak_info_plist.py',
947                          '--breakpad=0',
948                          '--keystone=0',
949                          '--scm=0',
950                          '--version=<(content_shell_version)'],
951             },
952             {
953               # Make sure there isn't any Objective-C in the helper app's
954               # executable.
955               'postbuild_name': 'Verify No Objective-C',
956               'action': [
957                 '../build/mac/verify_no_objc.sh',
958               ],
959             },
960           ],
961           'conditions': [
962             ['component=="shared_library"', {
963               'xcode_settings': {
964                 'LD_RUNPATH_SEARCH_PATHS': [
965                   # Get back from Content Shell.app/Contents/Frameworks/
966                   #                                 Helper.app/Contents/MacOS
967                   '@loader_path/../../../../../..',
968                 ],
969               },
970             }],
971           ],
972         },  # target content_shell_helper_app
973       ],
974     }],  # OS=="mac"
975     ['OS=="android"', {
976       'targets': [
977         {
978           # TODO(jrg): Update this action and other jni generators to only
979           # require specifying the java directory and generate the rest.
980           'target_name': 'content_shell_jni_headers',
981           'type': 'none',
982           'sources': [
983             'shell/android/browsertests_apk/src/org/chromium/content_browsertests_apk/ContentBrowserTestsActivity.java',
984             'shell/android/java/src/org/chromium/content_shell/ShellLayoutTestUtils.java',
985             'shell/android/java/src/org/chromium/content_shell/ShellManager.java',
986             'shell/android/java/src/org/chromium/content_shell/Shell.java',
987           ],
988           'variables': {
989             'jni_gen_package': 'content/shell',
990             'jni_generator_ptr_type': 'long',
991           },
992           'includes': [ '../build/jni_generator.gypi' ],
993         },
994         {
995           'target_name': 'libcontent_shell_content_view',
996           'type': 'shared_library',
997           'dependencies': [
998             'content_shell_jni_headers',
999             'content_shell_lib',
1000             'content_shell_pak',
1001             # Skia is necessary to ensure the dependencies needed by
1002             # WebContents are included.
1003             '../skia/skia.gyp:skia',
1004             '<(DEPTH)/media/media.gyp:player_android',
1005           ],
1006           'sources': [
1007             'shell/android/shell_library_loader.cc',
1008             'shell/android/shell_library_loader.h',
1009           ],
1010           'conditions': [
1011             ['android_webview_build==1', {
1012               'ldflags': [
1013                 '-lgabi++',  # For rtti
1014               ],
1015             }],
1016           ],
1017         },
1018         {
1019           'target_name': 'content_shell_java',
1020           'type': 'none',
1021           'dependencies': [
1022             'content.gyp:content_java',
1023           ],
1024           'variables': {
1025             'java_in_dir': '../content/shell/android/java',
1026             'has_java_resources': 1,
1027             'R_package': 'org.chromium.content_shell',
1028             'R_package_relpath': 'org/chromium/content_shell',
1029           },
1030           'includes': [ '../build/java.gypi' ],
1031         },
1032         {
1033           # content_shell_apk creates a .jar as a side effect. Any java targets
1034           # that need that .jar in their classpath should depend on this target,
1035           # content_shell_apk_java. Dependents of content_shell_apk receive its
1036           # jar path in the variable 'apk_output_jar_path'. This target should
1037           # only be used by targets which instrument content_shell_apk.
1038           'target_name': 'content_shell_apk_java',
1039           'type': 'none',
1040           'dependencies': [
1041             'content_shell_apk',
1042           ],
1043           'includes': [ '../build/apk_fake_jar.gypi' ],
1044         },
1045         {
1046           'target_name': 'content_shell_apk',
1047           'type': 'none',
1048           'dependencies': [
1049             'content.gyp:content_icudata',
1050             'content.gyp:content_java',
1051             'content_java_test_support',
1052             'content_shell_java',
1053             'libcontent_shell_content_view',
1054             '../base/base.gyp:base_java',
1055             '../media/media.gyp:media_java',
1056             '../net/net.gyp:net_java',
1057             '../third_party/mesa/mesa.gyp:osmesa_in_lib_dir',
1058             '../tools/android/forwarder/forwarder.gyp:forwarder',
1059             '../ui/android/ui_android.gyp:ui_java',
1060           ],
1061           'variables': {
1062             'apk_name': 'ContentShell',
1063             'manifest_package_name': 'org.chromium.content_shell_apk',
1064             'java_in_dir': 'shell/android/shell_apk',
1065             'resource_dir': 'shell/android/shell_apk/res',
1066             'native_lib_target': 'libcontent_shell_content_view',
1067             'additional_input_paths': ['<(PRODUCT_DIR)/content_shell/assets/content_shell.pak'],
1068             'asset_location': '<(PRODUCT_DIR)/content_shell/assets',
1069             'extra_native_libs': ['<(SHARED_LIB_DIR)/libosmesa.so'],
1070             'conditions': [
1071               ['icu_use_data_file_flag==1', {
1072                 'additional_input_paths': [
1073                   '<(PRODUCT_DIR)/icudtl.dat',
1074                 ],
1075               }],
1076             ],
1077           },
1078           'conditions': [
1079             ['android_webview_build==0', {
1080               'dependencies': [
1081                 '../tools/imagediff/image_diff.gyp:image_diff#host',
1082               ],
1083             }],
1084           ],
1085           'includes': [ '../build/java_apk.gypi' ],
1086         },
1087       ],
1088     }],  # OS=="android"
1089     ['OS=="win"', {
1090       'targets': [
1091         {
1092           'target_name': 'content_shell_crash_service',
1093           'type': 'executable',
1094           'dependencies': [
1095             '../base/base.gyp:base',
1096             '../components/components.gyp:breakpad_crash_service',
1097           ],
1098           'include_dirs': [
1099             '..',
1100           ],
1101           'sources': [
1102             'shell/tools/content_shell_crash_service.cc',
1103           ],
1104           'msvs_settings': {
1105             'VCLinkerTool': {
1106               'SubSystem': '2',         # Set /SUBSYSTEM:WINDOWS
1107             },
1108           },
1109         },
1110       ],
1111     }],  # OS=="win"
1112     ['OS=="win" and fastbuild==0 and target_arch=="ia32"', {
1113       'variables': {
1114         'dest_dir': '<(PRODUCT_DIR)/syzygy',
1115       },
1116       'targets': [
1117         {
1118           'target_name': 'content_shell_syzyasan',
1119           'type': 'none',
1120           'sources' : [],
1121           # Instrument content_shell with SyzyAsan.
1122           'actions': [
1123             {
1124               'action_name': 'Instrument content_shell with SyzyAsan',
1125               'inputs': [
1126                 '<(PRODUCT_DIR)/content_shell.exe',
1127               ],
1128               'outputs': [
1129                 '<(dest_dir)/content_shell.exe',
1130                 '<(dest_dir)/content_shell.exe.pdb',
1131               ],
1132               'action': [
1133                 'python',
1134                 '<(DEPTH)/chrome/tools/build/win/syzygy_instrument.py',
1135                 '--mode', 'asan',
1136                 '--input_executable', '<(PRODUCT_DIR)/content_shell.exe',
1137                 '--input_symbol', '<(PRODUCT_DIR)/content_shell.exe.pdb',
1138                 '--destination_dir', '<(dest_dir)',
1139               ],
1140             },
1141           ],
1142         },
1143       ],
1144     }],  # OS=="win" and fastbuild==0 and target_arch=="ia32"
1145   ]