Upstream version 6.34.115.0
[platform/framework/web/crosswalk.git] / src / xwalk / xwalk.gyp
1 {
2   'variables': {
3     'xwalk_product_name': 'XWalk',
4     'xwalk_version': '<!(python ../chrome/tools/build/version.py -f VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
5     'chrome_version': '<!(python ../chrome/tools/build/version.py -f ../chrome/VERSION -t "@MAJOR@.@MINOR@.@BUILD@.@PATCH@")',
6     'conditions': [
7       ['OS=="linux"', {
8        'use_custom_freetype%': 1,
9       }, {
10        'use_custom_freetype%': 0,
11       }],
12     ], # conditions
13   },
14   'includes' : [
15     'xwalk_tests.gypi',
16     'application/xwalk_application.gypi',
17   ],
18   'targets': [
19     {
20       'target_name': 'xwalk_runtime',
21       'type': 'static_library',
22       'defines!': ['CONTENT_IMPLEMENTATION'],
23       'defines': ['XWALK_VERSION="<(xwalk_version)"','CHROME_VERSION="<(chrome_version)"'],
24       'variables': {
25         'chromium_code': 1,
26       },
27       'dependencies': [
28         '../base/base.gyp:base',
29         '../base/base.gyp:base_i18n',
30         '../base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations',
31         '../cc/cc.gyp:cc',
32         '../components/components.gyp:visitedlink_browser',
33         '../components/components.gyp:visitedlink_renderer',
34         '../content/content.gyp:content',
35         '../content/content.gyp:content_app_both',
36         '../content/content.gyp:content_browser',
37         '../content/content.gyp:content_common',
38         '../content/content.gyp:content_gpu',
39         '../content/content.gyp:content_plugin',
40         '../content/content.gyp:content_ppapi_plugin',
41         '../content/content.gyp:content_renderer',
42         '../content/content.gyp:content_utility',
43         '../content/content.gyp:content_worker',
44         '../content/content_resources.gyp:content_resources',
45         '../ipc/ipc.gyp:ipc',
46         '../media/media.gyp:media',
47         '../net/net.gyp:net',
48         '../net/net.gyp:net_resources',
49         '../skia/skia.gyp:skia',
50         '../third_party/WebKit/public/blink.gyp:blink',
51         '../ui/gl/gl.gyp:gl',
52         '../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
53         '../ui/ui.gyp:ui',
54         '../url/url.gyp:url_lib',
55         '../v8/tools/gyp/v8.gyp:v8',
56         '../webkit/common/webkit_common.gyp:webkit_common',
57         '../webkit/common/user_agent/webkit_user_agent.gyp:user_agent',
58         '../webkit/child/webkit_child.gyp:webkit_child',
59         '../webkit/webkit_resources.gyp:webkit_resources',
60         'xwalk_application_lib',
61         'xwalk_resources',
62         'extensions/extensions.gyp:xwalk_extensions',
63         'sysapps/sysapps.gyp:sysapps',
64       ],
65       'include_dirs': [
66         '..',
67       ],
68       'sources': [
69         'runtime/app/android/xwalk_main_delegate_android.cc',
70         'runtime/app/android/xwalk_main_delegate_android.h',
71         'runtime/app/xwalk_main_delegate.cc',
72         'runtime/app/xwalk_main_delegate.h',
73         'runtime/browser/android/cookie_manager.cc',
74         'runtime/browser/android/cookie_manager.h',
75         'runtime/browser/android/intercepted_request_data.h',
76         'runtime/browser/android/intercepted_request_data_impl.cc',
77         'runtime/browser/android/intercepted_request_data_impl.h',
78         'runtime/browser/android/net/android_protocol_handler.cc',
79         'runtime/browser/android/net/android_protocol_handler.h',
80         'runtime/browser/android/net/android_stream_reader_url_request_job.cc',
81         'runtime/browser/android/net/android_stream_reader_url_request_job.h',
82         'runtime/browser/android/net/input_stream.h',
83         'runtime/browser/android/net/input_stream_impl.cc',
84         'runtime/browser/android/net/input_stream_impl.h',
85         'runtime/browser/android/net/input_stream_reader.cc',
86         'runtime/browser/android/net/input_stream_reader.h',
87         'runtime/browser/android/net/url_constants.cc',
88         'runtime/browser/android/net/url_constants.h',
89         'runtime/browser/android/net/xwalk_url_request_job_factory.cc',
90         'runtime/browser/android/net/xwalk_url_request_job_factory.h',
91         'runtime/browser/android/net_disk_cache_remover.cc',
92         'runtime/browser/android/net_disk_cache_remover.h',
93         'runtime/browser/android/renderer_host/xwalk_render_view_host_ext.cc',
94         'runtime/browser/android/renderer_host/xwalk_render_view_host_ext.h',
95         'runtime/browser/android/state_serializer.cc',
96         'runtime/browser/android/state_serializer.h',
97         'runtime/browser/android/xwalk_content.cc',
98         'runtime/browser/android/xwalk_content.h',
99         'runtime/browser/android/xwalk_contents_client_bridge.cc',
100         'runtime/browser/android/xwalk_contents_client_bridge.h',
101         'runtime/browser/android/xwalk_contents_client_bridge_base.cc',
102         'runtime/browser/android/xwalk_contents_client_bridge_base.h',
103         'runtime/browser/android/xwalk_contents_io_thread_client.h',
104         'runtime/browser/android/xwalk_contents_io_thread_client_impl.cc',
105         'runtime/browser/android/xwalk_contents_io_thread_client_impl.h',
106         'runtime/browser/android/xwalk_cookie_access_policy.cc',
107         'runtime/browser/android/xwalk_cookie_access_policy.h',
108         'runtime/browser/android/xwalk_dev_tools_server.cc',
109         'runtime/browser/android/xwalk_dev_tools_server.h',
110         'runtime/browser/android/xwalk_download_resource_throttle.cc',
111         'runtime/browser/android/xwalk_download_resource_throttle.h',
112         'runtime/browser/android/xwalk_http_auth_handler.cc',
113         'runtime/browser/android/xwalk_http_auth_handler.h',
114         'runtime/browser/android/xwalk_http_auth_handler_base.cc',
115         'runtime/browser/android/xwalk_http_auth_handler_base.h',
116         'runtime/browser/android/xwalk_login_delegate.cc',
117         'runtime/browser/android/xwalk_login_delegate.h',
118         'runtime/browser/android/xwalk_request_interceptor.cc',
119         'runtime/browser/android/xwalk_request_interceptor.h',
120         'runtime/browser/android/xwalk_settings.cc',
121         'runtime/browser/android/xwalk_web_contents_delegate.cc',
122         'runtime/browser/android/xwalk_web_contents_delegate.h',
123         'runtime/browser/android/xwalk_web_contents_view_delegate.cc',
124         'runtime/browser/android/xwalk_web_contents_view_delegate.h',
125         'runtime/browser/application_component.cc',
126         'runtime/browser/application_component.h',
127         'runtime/browser/devtools/remote_debugging_server.cc',
128         'runtime/browser/devtools/remote_debugging_server.h',
129         'runtime/browser/devtools/xwalk_devtools_delegate.cc',
130         'runtime/browser/devtools/xwalk_devtools_delegate.h',
131         'runtime/browser/geolocation/tizen/location_provider_tizen.cc',
132         'runtime/browser/geolocation/tizen/location_provider_tizen.h',
133         'runtime/browser/geolocation/xwalk_access_token_store.cc',
134         'runtime/browser/geolocation/xwalk_access_token_store.h',
135         'runtime/browser/image_util.cc',
136         'runtime/browser/image_util.h',
137         'runtime/browser/media/media_capture_devices_dispatcher.cc',
138         'runtime/browser/media/media_capture_devices_dispatcher.h',
139         'runtime/browser/runtime.cc',
140         'runtime/browser/runtime.h',
141         'runtime/browser/runtime_context.cc',
142         'runtime/browser/runtime_context.h',
143         'runtime/browser/runtime_download_manager_delegate.cc',
144         'runtime/browser/runtime_download_manager_delegate.h',
145         'runtime/browser/runtime_file_select_helper.cc',
146         'runtime/browser/runtime_file_select_helper.h',
147         'runtime/browser/runtime_geolocation_permission_context.cc',
148         'runtime/browser/runtime_geolocation_permission_context.h',
149         'runtime/browser/runtime_javascript_dialog_manager.cc',
150         'runtime/browser/runtime_javascript_dialog_manager.h',
151         'runtime/browser/runtime_network_delegate.cc',
152         'runtime/browser/runtime_network_delegate.h',
153         'runtime/browser/runtime_platform_util.h',
154         'runtime/browser/runtime_platform_util_android.cc',
155         'runtime/browser/runtime_platform_util_aura.cc',
156         'runtime/browser/runtime_platform_util_linux.cc',
157         'runtime/browser/runtime_platform_util_mac.mm',
158         'runtime/browser/runtime_platform_util_win.cc',
159         'runtime/browser/runtime_quota_permission_context.cc',
160         'runtime/browser/runtime_quota_permission_context.h',
161         'runtime/browser/runtime_resource_dispatcher_host_delegate.cc',
162         'runtime/browser/runtime_resource_dispatcher_host_delegate.h',
163         'runtime/browser/runtime_resource_dispatcher_host_delegate_android.cc',
164         'runtime/browser/runtime_resource_dispatcher_host_delegate_android.h',
165         'runtime/browser/runtime_select_file_policy.cc',
166         'runtime/browser/runtime_select_file_policy.h',
167         'runtime/browser/runtime_url_request_context_getter.cc',
168         'runtime/browser/runtime_url_request_context_getter.h',
169         'runtime/browser/speech/speech_recognition_manager_delegate.cc',
170         'runtime/browser/speech/speech_recognition_manager_delegate.h',
171         'runtime/browser/sysapps_component.cc',
172         'runtime/browser/sysapps_component.h',
173         'runtime/browser/ui/color_chooser.cc',
174         'runtime/browser/ui/color_chooser.h',
175         'runtime/browser/ui/color_chooser_android.cc',
176         'runtime/browser/ui/color_chooser_aura.cc',
177         'runtime/browser/ui/color_chooser_mac.cc',
178         'runtime/browser/ui/native_app_window.cc',
179         'runtime/browser/ui/native_app_window.h',
180         'runtime/browser/ui/native_app_window_android.cc',
181         'runtime/browser/ui/native_app_window_mac.h',
182         'runtime/browser/ui/native_app_window_mac.mm',
183         'runtime/browser/ui/native_app_window_tizen.cc',
184         'runtime/browser/ui/native_app_window_tizen.h',
185         'runtime/browser/ui/native_app_window_views.cc',
186         'runtime/browser/ui/native_app_window_views.h',
187         'runtime/browser/ui/taskbar_util.h',
188         'runtime/browser/ui/taskbar_util_win.cc',
189         'runtime/browser/ui/top_view_layout_views.cc',
190         'runtime/browser/ui/top_view_layout_views.h',
191         'runtime/browser/ui/xwalk_views_delegate.cc',
192         'runtime/browser/ui/xwalk_views_delegate.h',
193         'runtime/browser/xwalk_app_extension_bridge.cc',
194         'runtime/browser/xwalk_app_extension_bridge.h',
195         'runtime/browser/xwalk_application_mac.h',
196         'runtime/browser/xwalk_application_mac.mm',
197         'runtime/browser/xwalk_browser_main_parts.cc',
198         'runtime/browser/xwalk_browser_main_parts.h',
199         'runtime/browser/xwalk_browser_main_parts_android.cc',
200         'runtime/browser/xwalk_browser_main_parts_android.h',
201         'runtime/browser/xwalk_browser_main_parts_mac.h',
202         'runtime/browser/xwalk_browser_main_parts_mac.mm',
203         'runtime/browser/xwalk_browser_main_parts_tizen.cc',
204         'runtime/browser/xwalk_browser_main_parts_tizen.h',
205         'runtime/browser/xwalk_component.h',
206         'runtime/browser/xwalk_content_browser_client.cc',
207         'runtime/browser/xwalk_content_browser_client.h',
208         'runtime/browser/xwalk_runner.cc',
209         'runtime/browser/xwalk_runner.h',
210         'runtime/browser/xwalk_runner_android.cc',
211         'runtime/browser/xwalk_runner_android.h',
212         'runtime/browser/xwalk_runner_tizen.cc',
213         'runtime/browser/xwalk_runner_tizen.h',
214         'runtime/common/android/xwalk_globals_android.cc',
215         'runtime/common/android/xwalk_globals_android.h',
216         'runtime/common/android/xwalk_hit_test_data.cc',
217         'runtime/common/android/xwalk_hit_test_data.h',
218         'runtime/common/android/xwalk_message_generator.cc',
219         'runtime/common/android/xwalk_message_generator.h',
220         'runtime/common/android/xwalk_render_view_messages.cc',
221         'runtime/common/android/xwalk_render_view_messages.h',
222         'runtime/common/paths_mac.h',
223         'runtime/common/paths_mac.mm',
224         'runtime/common/xwalk_common_messages.cc',
225         'runtime/common/xwalk_common_messages.h',
226         'runtime/common/xwalk_common_message_generator.cc',
227         'runtime/common/xwalk_common_message_generator.h',
228         'runtime/common/xwalk_content_client.cc',
229         'runtime/common/xwalk_content_client.h',
230         'runtime/common/xwalk_paths.cc',
231         'runtime/common/xwalk_paths.h',
232         'runtime/common/xwalk_runtime_features.cc',
233         'runtime/common/xwalk_runtime_features.h',
234         'runtime/common/xwalk_switches.cc',
235         'runtime/common/xwalk_switches.h',
236         'runtime/renderer/android/xwalk_render_process_observer.cc',
237         'runtime/renderer/android/xwalk_render_process_observer.h',
238         'runtime/renderer/android/xwalk_permission_client.cc',
239         'runtime/renderer/android/xwalk_permission_client.h',
240         'runtime/renderer/android/xwalk_render_view_ext.cc',
241         'runtime/renderer/android/xwalk_render_view_ext.h',
242         'runtime/renderer/tizen/xwalk_content_renderer_client_tizen.cc',
243         'runtime/renderer/tizen/xwalk_content_renderer_client_tizen.h',
244         'runtime/renderer/xwalk_content_renderer_client.cc',
245         'runtime/renderer/xwalk_content_renderer_client.h',
246         'runtime/renderer/xwalk_render_process_observer_generic.cc',
247         'runtime/renderer/xwalk_render_process_observer_generic.h',
248       ],
249       'includes': [
250         'xwalk_jsapi.gypi',
251       ],
252       'msvs_settings': {
253         'VCLinkerTool': {
254           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
255         },
256       },
257       'conditions': [
258         [ 'tizen == 1 or tizen_mobile == 1', {
259           'dependencies': [
260             'build/system.gyp:tizen_geolocation',
261             'sysapps/sysapps_resources.gyp:xwalk_sysapps_resources',
262             'tizen/xwalk_tizen.gypi:xwalk_tizen_lib',
263             '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
264           ],
265           'sources': [
266             'runtime/browser/ui/screen_orientation.h',
267             'runtime/extension/screen_orientation_extension.cc',
268             'runtime/extension/screen_orientation_extension.h',
269           ],
270         }],
271         ['OS=="android"',{
272           'dependencies':[
273             'xwalk_core_jar_jni',
274             'xwalk_core_native_jni',
275           ],
276           'sources!':[
277             'runtime/renderer/xwalk_render_process_observer_generic.cc',
278             'runtime/renderer/xwalk_render_process_observer_generic.h',
279           ],
280         }],
281         ['OS=="win" and win_use_allocator_shim==1', {
282           'dependencies': [
283             '../base/allocator/allocator.gyp:allocator',
284           ],
285         }],
286         ['OS=="win"', {
287           'resource_include_dirs': [
288             '<(SHARED_INTERMEDIATE_DIR)/webkit',
289           ],
290           'configurations': {
291             'Debug_Base': {
292               'msvs_settings': {
293                 'VCLinkerTool': {
294                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
295                 },
296               },
297             },
298           },
299           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
300           'msvs_disabled_warnings': [ 4267, ],
301         }],  # OS=="win"
302         ['OS=="linux"', {
303           'dependencies': [
304             '../build/linux/system.gyp:fontconfig',
305           ],
306         }],  # OS=="linux"
307         ['os_posix==1 and OS != "mac" and linux_use_tcmalloc==1', {
308           'dependencies': [
309             # This is needed by content/app/content_main_runner.cc
310             '../base/allocator/allocator.gyp:allocator',
311           ],
312         }],  # os_posix==1 and OS != "mac" and linux_use_tcmalloc==1
313         ['use_custom_freetype==1', {
314           'dependencies': [
315              '../third_party/freetype2/freetype2.gyp:freetype2',
316           ],
317         }],  # use_custom_freetype==1
318         ['toolkit_views==1', {
319           'dependencies': [
320             '../ui/base/strings/ui_strings.gyp:ui_strings',
321             '../ui/views/controls/webview/webview.gyp:webview',
322             '../ui/views/views.gyp:views',
323             '../ui/views/views.gyp:views_test_support',
324             '../ui/resources/ui_resources.gyp:ui_resources',
325           ],
326         }],  # toolkit_views==1
327         ['use_aura==1', {
328           'dependencies': [
329             '../ui/aura/aura.gyp:aura',
330           ],
331         }, {  # use_aura==0
332           'sources/': [
333             ['exclude', '_aura\\.cc$'],
334           ],
335         }],
336       ],
337     },
338     {
339       'target_name': 'xwalk_resources',
340       'type': 'none',
341       'dependencies': [
342         'generate_xwalk_resources',
343       ],
344       'variables': {
345         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/xwalk',
346       },
347       'includes': [ '../build/grit_target.gypi' ],
348       'copies': [
349         {
350           'destination': '<(PRODUCT_DIR)',
351           'files': [
352             '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_resources.pak'
353           ],
354         },
355       ],
356     },
357     {
358       'target_name': 'generate_xwalk_resources',
359       'type': 'none',
360       'variables': {
361         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/xwalk',
362       },
363       'actions': [
364         {
365           'action_name': 'xwalk_resources',
366           'variables': {
367             'grit_resource_ids': 'resources/resource_ids',
368             'grit_grd_file': 'runtime/resources/xwalk_resources.grd',
369           },
370           'includes': [ '../build/grit_action.gypi' ],
371         },
372       ],
373     },
374     {
375       # Build a minimal set of resources so Blink in XWalk has
376       # access to necessary resources.
377       'target_name': 'xwalk_pak',
378       'type': 'none',
379       'dependencies': [
380         '<(DEPTH)/ui/base/strings/ui_strings.gyp:ui_strings',
381         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
382         'xwalk_resources',
383       ],
384       'conditions': [
385         [ 'OS!="android"', {
386           'dependencies': [
387             '<(DEPTH)/content/browser/devtools/devtools_resources.gyp:devtools_resources',
388           ],
389         }],
390       ],
391       'variables': {
392         'repack_path': '../tools/grit/grit/format/repack.py',
393       },
394       'actions': [
395         {
396           'action_name': 'repack_xwalk_resources',
397           'variables': {
398             'pak_inputs': [
399               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_resources.pak',
400               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_application_resources.pak',
401               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_extensions_resources.pak',
402               '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_sysapps_resources.pak',
403               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
404               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
405               '<(SHARED_INTERMEDIATE_DIR)/ui/app_locale_settings/app_locale_settings_en-US.pak',
406               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_strings/ui_strings_en-US.pak',
407               '<(SHARED_INTERMEDIATE_DIR)/ui/ui_resources/ui_resources_100_percent.pak',
408               '<(SHARED_INTERMEDIATE_DIR)/webkit/blink_resources.pak',
409               '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_resources_100_percent.pak',
410               '<(SHARED_INTERMEDIATE_DIR)/webkit/webkit_strings_en-US.pak',
411             ],
412           },
413           'conditions': [
414             [ 'OS!="android"', {
415               'variables': {
416                 'pak_inputs+': [
417                   '<(SHARED_INTERMEDIATE_DIR)/webkit/devtools_resources.pak',
418                 ],
419               },
420             }],
421             [ 'tizen_mobile == 1', {
422               'variables': {
423                 'pak_inputs+': [
424                   '<(SHARED_INTERMEDIATE_DIR)/xwalk/xwalk_sysapps_resources.pak',
425                 ],
426               },
427             }],
428           ],
429           'inputs': [
430             '<(repack_path)',
431             '<@(pak_inputs)',
432           ],
433           'action': ['python', '<(repack_path)', '<@(_outputs)',
434                      '<@(pak_inputs)'],
435           'outputs':[
436             '<(PRODUCT_DIR)/xwalk.pak',
437           ],
438         },
439       ],
440     },
441     {
442       'target_name': 'xwalk',
443       'type': 'executable',
444       'mac_bundle': 1,
445       'defines!': ['CONTENT_IMPLEMENTATION'],
446       'dependencies': [
447         'xwalk_runtime',
448         'xwalk_pak',
449       ],
450       'include_dirs': [
451         '..',
452       ],
453       'sources': [
454         'runtime/app/xwalk_main.cc',
455       ],
456       'mac_bundle_resources': [
457         'runtime/app/app.icns',
458         'runtime/app/app-Info.plist',
459       ],
460       # TODO(mark): Come up with a fancier way to do this.  It should only
461       # be necessary to list app-Info.plist once, not the three times it is
462       # listed here.
463       'mac_bundle_resources!': [
464         'runtime/app/app-Info.plist',
465       ],
466       'xcode_settings': {
467         'INFOPLIST_FILE': 'runtime/app/app-Info.plist',
468       },
469       'msvs_settings': {
470         'VCLinkerTool': {
471           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
472         },
473       },
474       'conditions': [
475         ['OS=="win" and win_use_allocator_shim==1', {
476           'dependencies': [
477             '../base/allocator/allocator.gyp:allocator',
478           ],
479         }],
480         ['OS=="win"', {
481           'sources': [
482             '../content/app/startup_helper_win.cc', # Needed by InitializedSandbox
483             'runtime/resources/xwalk.rc',
484           ],
485           'copies': [
486             {
487               'destination': '<(PRODUCT_DIR)',
488               'files': [
489                 'tools/packaging/bootstrapped/win/app.wxs.templ',
490                 'tools/packaging/bootstrapped/win/create_windows_installer.bat',
491                 'tools/packaging/bootstrapped/win/guid.vbs',
492               ],
493             },
494           ],
495           'configurations': {
496             'Debug_Base': {
497               'msvs_settings': {
498                 'VCLinkerTool': {
499                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
500                 },
501               },
502             },
503           },
504         }],  # OS=="win"
505         ['OS == "win"', {
506           'dependencies': [
507             '../sandbox/sandbox.gyp:sandbox',
508           ],
509         }],  # OS=="win"
510         ['OS == "linux"', {
511           'copies': [
512             {
513               'destination': '<(PRODUCT_DIR)',
514               'files': [
515                 'tools/packaging/bootstrapped/linux/app.desktop.templ',
516                 'tools/packaging/bootstrapped/linux/create_linux_installer.sh',
517                 'tools/packaging/bootstrapped/linux/Makefile.templ',
518               ],
519             }
520           ],
521         }],
522         ['OS=="mac"', {
523           'product_name': '<(xwalk_product_name)',
524           'dependencies!': [
525             'xwalk_runtime',
526           ],
527           'dependencies': [
528             'xwalk_framework',
529             'xwalk_helper_app',
530           ],
531           'copies': [
532             {
533               'destination': '<(PRODUCT_DIR)/<(xwalk_product_name).app/Contents/Frameworks',
534               'files': [
535                 '<(PRODUCT_DIR)/<(xwalk_product_name) Helper.app',
536               ],
537             },
538           ],
539           'postbuilds': [
540             {
541               'postbuild_name': 'Copy <(xwalk_product_name) Framework.framework',
542               'action': [
543                 '../build/mac/copy_framework_unversioned.sh',
544                 '${BUILT_PRODUCTS_DIR}/<(xwalk_product_name) Framework.framework',
545                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
546               ],
547             },
548             {
549               'postbuild_name': 'Fix Framework Link',
550               'action': [
551                 'install_name_tool',
552                 '-change',
553                 '/Library/Frameworks/<(xwalk_product_name) Framework.framework/Versions/A/<(xwalk_product_name) Framework',
554                 '@executable_path/../Frameworks/<(xwalk_product_name) Framework.framework/<(xwalk_product_name) Framework',
555                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
556               ],
557             },
558             {
559               # Modify the Info.plist as needed.
560               'postbuild_name': 'Tweak Info.plist',
561               'action': ['../build/mac/tweak_info_plist.py',
562                          '--scm=1',
563                          '--version=<(xwalk_version)'],
564             },
565             {
566               # This postbuid step is responsible for creating the following
567               # helpers:
568               #
569               # XWalk Helper EH.app and XWalk Helper NP.app are
570               # created from XWalk Helper.app.
571               #
572               # The EH helper is marked for an executable heap. The NP helper
573               # is marked for no PIE (ASLR).
574               'postbuild_name': 'Make More Helpers',
575               'action': [
576                 '../build/mac/make_more_helpers.sh',
577                 'Frameworks',
578                 '<(xwalk_product_name)',
579               ],
580             },
581             {
582               # Make sure there isn't any Objective-C in the xwalk's
583               # executable.
584               'postbuild_name': 'Verify No Objective-C',
585               'action': [
586                 '../build/mac/verify_no_objc.sh',
587               ],
588             },
589           ],
590         }],  # OS=="mac"
591       ],
592     },
593     {
594       'target_name': 'xwalk_builder',
595       'type': 'none',
596       'conditions': [
597         ['OS!="android"', {
598           'dependencies': [
599             'xwalk',
600             'xwalk_all_tests',
601             'xwalk_xpk_generator',
602           ],
603         },
604         {
605           'dependencies': [
606             # For internal testing.
607             'xwalk_core_shell_apk',
608             'xwalk_core_test_apk',
609             'xwalk_runtime_shell_apk',
610             'xwalk_runtime_client_embedded_shell_apk',
611             'xwalk_runtime_client_embedded_test_apk',
612             'xwalk_runtime_client_shell_apk',
613             'xwalk_runtime_client_test_apk',
614
615             # For external testing.
616             'pack_xwalk_core_library',
617             'xwalk_runtime_lib_apk',
618             'xwalk_app_hello_world_apk',
619             'xwalk_app_template',
620           ],
621         }],
622       ],
623     },
624     {
625       'target_name': 'xwalk_xpk_generator',
626       'type': 'none',
627       'copies': [
628         {
629           'destination': '<(PRODUCT_DIR)/tools',
630           'files': [
631             'tools/make_xpk.py',
632           ],
633         },
634       ],
635     },
636   ], # targets
637   'conditions': [
638     ['OS=="linux"', {
639       'includes': [ 'extensions/xesh/xesh.gypi' ],
640     }],
641     ['OS=="mac"', {
642       'targets': [
643         {
644           'target_name': 'xwalk_framework',
645           'type': 'shared_library',
646           'product_name': '<(xwalk_product_name) Framework',
647           'mac_bundle': 1,
648           'mac_bundle_resources': [
649             'runtime/app/English.lproj/MainMenu.xib',
650             '<(PRODUCT_DIR)/xwalk.pak'
651           ],
652           'dependencies': [
653             'xwalk_runtime',
654           ],
655           'include_dirs': [
656             '..',
657           ],
658           'sources': [
659             'runtime/app/xwalk_content_main.cc',
660             'runtime/app/xwalk_content_main.h',
661           ],
662           'copies': [
663             {
664               # Copy FFmpeg binaries for audio/video support.
665               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
666               'files': [
667                 '<(PRODUCT_DIR)/ffmpegsumo.so',
668               ],
669             },
670           ],
671           'conditions': [
672             ['enable_webrtc==1', {
673               'variables': {
674                 'libpeer_target_type%': 'static_library',
675               },
676               'conditions': [
677                 ['libpeer_target_type!="static_library"', {
678                   'copies': [{
679                    'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
680                    'files': [
681                       '<(PRODUCT_DIR)/libpeerconnection.so',
682                     ],
683                   }],
684                 }],
685               ],
686             }],
687           ],
688         },  # target xwalk_framework
689         {
690           'target_name': 'xwalk_helper_app',
691           'type': 'executable',
692           'variables': { 'enable_wexit_time_destructors': 1, },
693           'product_name': '<(xwalk_product_name) Helper',
694           'mac_bundle': 1,
695           'dependencies': [
696             'xwalk_framework',
697           ],
698           'sources': [
699             'runtime/app/xwalk_main.cc',
700             'runtime/app/helper-Info.plist',
701           ],
702           # TODO(mark): Come up with a fancier way to do this.  It should only
703           # be necessary to list helper-Info.plist once, not the three times it
704           # is listed here.
705           'mac_bundle_resources!': [
706             'runtime/app/helper-Info.plist',
707           ],
708           # TODO(mark): For now, don't put any resources into this app.  Its
709           # resources directory will be a symbolic link to the browser app's
710           # resources directory.
711           'mac_bundle_resources/': [
712             ['exclude', '.*'],
713           ],
714           'xcode_settings': {
715             'INFOPLIST_FILE': 'runtime/app/helper-Info.plist',
716           },
717           'postbuilds': [
718             {
719               # The framework defines its load-time path
720               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
721               # (chrome).  A different relative path needs to be used in
722               # xwalk_helper_app.
723               'postbuild_name': 'Fix Framework Link',
724               'action': [
725                 'install_name_tool',
726                 '-change',
727                 '/Library/Frameworks/<(xwalk_product_name) Framework.framework/Versions/A/<(xwalk_product_name) Framework',
728                 '@executable_path/../../../../Frameworks/<(xwalk_product_name) Framework.framework/<(xwalk_product_name) Framework',
729                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
730               ],
731             },
732             {
733               # Modify the Info.plist as needed.  The script explains why this
734               # is needed.  This is also done in the chrome and chrome_dll
735               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
736               # are used because Breakpad, Keystone, and SCM keys are
737               # never placed into the helper.
738               'postbuild_name': 'Tweak Info.plist',
739               'action': ['../build/mac/tweak_info_plist.py',
740                          '--breakpad=0',
741                          '--keystone=0',
742                          '--scm=0',
743                          '--version=<(xwalk_version)'],
744             },
745             {
746               # Make sure there isn't any Objective-C in the helper app's
747               # executable.
748               'postbuild_name': 'Verify No Objective-C',
749               'action': [
750                 '../build/mac/verify_no_objc.sh',
751               ],
752             },
753           ],
754           'conditions': [
755             ['component=="shared_library"', {
756               'xcode_settings': {
757                 'LD_RUNPATH_SEARCH_PATHS': [
758                   # Get back from XWalk.app/Contents/Frameworks/
759                   #                                 Helper.app/Contents/MacOS
760                   '@loader_path/../../../../../..',
761                 ],
762               },
763             }],
764           ],
765         },  # target xwalk_helper_app
766       ],
767     }],  # OS=="mac"
768     ['OS=="android"', {
769       'variables': {
770         'variables': {
771           'conditions': [
772             ['android_app_abi=="x86"', {
773               'version_code_shift%': 1,
774             }],
775             ['android_app_abi=="armeabi-v7a"', {
776               'version_code_shift%': 2,
777             }],
778             ['android_app_abi=="armeabi"', {
779               'version_code_shift%': 3,
780             }],
781           ], # conditions
782         },
783         'version_code_shift%': '<(version_code_shift)',
784         'xwalk_version_code': '<!(python tools/build/android/generate_version_code.py -f VERSION -s <(version_code_shift))',
785       },
786       'includes': [
787         'xwalk_android.gypi',
788         'xwalk_android_tests.gypi',
789         'xwalk_android_app.gypi',
790         'xwalk_core_library_android.gypi',
791       ],
792       'targets': [
793       {
794         'target_name': 'All',
795         'type': 'none',
796         'dependencies': [
797           'xwalk',
798         ],
799       }, # target_name: All
800     ],  # targets
801     }], # OS=="android"
802   ]
803 }