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