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