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