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