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