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