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