fe20cd4e33613c796fecc39943705646744ecb84
[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         '../ipc/ipc.gyp:ipc',
47         '../media/media.gyp:media',
48         '../net/net.gyp:net',
49         '../net/net.gyp:net_resources',
50         '../skia/skia.gyp:skia',
51         '../storage/storage_browser.gyp:storage',
52         '../storage/storage_common.gyp:storage_common',
53         '../third_party/WebKit/public/blink.gyp:blink',
54         '../ui/base/ui_base.gyp:ui_base',
55         '../ui/gl/gl.gyp:gl',
56         '../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
57         '../url/url.gyp:url_lib',
58         '../v8/tools/gyp/v8.gyp:v8',
59         'xwalk_application_lib',
60         'xwalk_resources',
61         'extensions/extensions.gyp:xwalk_extensions',
62         'sysapps/sysapps.gyp:sysapps',
63       ],
64       'include_dirs': [
65         '..',
66       ],
67       'sources': [
68         '../extensions/common/constants.cc',
69         '../extensions/common/constants.h',
70         '../extensions/common/url_pattern.cc',
71         '../extensions/common/url_pattern.h',
72         'experimental/native_file_system/native_file_system_extension.cc',
73         'experimental/native_file_system/native_file_system_extension.h',
74         'experimental/native_file_system/virtual_root_provider_mac.cc',
75         'experimental/native_file_system/virtual_root_provider_win.cc',
76         'experimental/native_file_system/virtual_root_provider.cc',
77         'experimental/native_file_system/virtual_root_provider.h',
78         'runtime/app/android/xwalk_main_delegate_android.cc',
79         'runtime/app/android/xwalk_main_delegate_android.h',
80         'runtime/app/xwalk_main_delegate.cc',
81         'runtime/app/xwalk_main_delegate.h',
82         'runtime/browser/android/cookie_manager.cc',
83         'runtime/browser/android/cookie_manager.h',
84         'runtime/browser/android/intercepted_request_data.h',
85         'runtime/browser/android/intercepted_request_data_impl.cc',
86         'runtime/browser/android/intercepted_request_data_impl.h',
87         'runtime/browser/android/net/android_protocol_handler.cc',
88         'runtime/browser/android/net/android_protocol_handler.h',
89         'runtime/browser/android/net/android_stream_reader_url_request_job.cc',
90         'runtime/browser/android/net/android_stream_reader_url_request_job.h',
91         'runtime/browser/android/net/input_stream.h',
92         'runtime/browser/android/net/input_stream_impl.cc',
93         'runtime/browser/android/net/input_stream_impl.h',
94         'runtime/browser/android/net/input_stream_reader.cc',
95         'runtime/browser/android/net/input_stream_reader.h',
96         'runtime/browser/android/net/url_constants.cc',
97         'runtime/browser/android/net/url_constants.h',
98         'runtime/browser/android/net/xwalk_url_request_job_factory.cc',
99         'runtime/browser/android/net/xwalk_url_request_job_factory.h',
100         'runtime/browser/android/net_disk_cache_remover.cc',
101         'runtime/browser/android/net_disk_cache_remover.h',
102         'runtime/browser/android/renderer_host/xwalk_render_view_host_ext.cc',
103         'runtime/browser/android/renderer_host/xwalk_render_view_host_ext.h',
104         'runtime/browser/android/state_serializer.cc',
105         'runtime/browser/android/state_serializer.h',
106         'runtime/browser/android/xwalk_content.cc',
107         'runtime/browser/android/xwalk_content.h',
108         'runtime/browser/android/xwalk_contents_client_bridge.cc',
109         'runtime/browser/android/xwalk_contents_client_bridge.h',
110         'runtime/browser/android/xwalk_contents_client_bridge_base.cc',
111         'runtime/browser/android/xwalk_contents_client_bridge_base.h',
112         'runtime/browser/android/xwalk_contents_io_thread_client.h',
113         'runtime/browser/android/xwalk_contents_io_thread_client_impl.cc',
114         'runtime/browser/android/xwalk_contents_io_thread_client_impl.h',
115         'runtime/browser/android/xwalk_cookie_access_policy.cc',
116         'runtime/browser/android/xwalk_cookie_access_policy.h',
117         'runtime/browser/android/xwalk_dev_tools_server.cc',
118         'runtime/browser/android/xwalk_dev_tools_server.h',
119         'runtime/browser/android/xwalk_download_resource_throttle.cc',
120         'runtime/browser/android/xwalk_download_resource_throttle.h',
121         'runtime/browser/android/xwalk_http_auth_handler.cc',
122         'runtime/browser/android/xwalk_http_auth_handler.h',
123         'runtime/browser/android/xwalk_http_auth_handler_base.cc',
124         'runtime/browser/android/xwalk_http_auth_handler_base.h',
125         'runtime/browser/android/xwalk_login_delegate.cc',
126         'runtime/browser/android/xwalk_login_delegate.h',
127         'runtime/browser/android/xwalk_path_helper.cc',
128         'runtime/browser/android/xwalk_path_helper.h',
129         'runtime/browser/android/xwalk_icon_helper.cc',
130         'runtime/browser/android/xwalk_icon_helper.h',
131         'runtime/browser/android/xwalk_request_interceptor.cc',
132         'runtime/browser/android/xwalk_request_interceptor.h',
133         'runtime/browser/android/xwalk_settings.cc',
134         'runtime/browser/android/xwalk_view_delegate.cc',
135         'runtime/browser/android/xwalk_view_delegate.h',
136         'runtime/browser/android/xwalk_web_contents_delegate.cc',
137         'runtime/browser/android/xwalk_web_contents_delegate.h',
138         'runtime/browser/android/xwalk_web_contents_view_delegate.cc',
139         'runtime/browser/android/xwalk_web_contents_view_delegate.h',
140         'runtime/browser/application_component.cc',
141         'runtime/browser/application_component.h',
142         'runtime/browser/devtools/remote_debugging_server.cc',
143         'runtime/browser/devtools/remote_debugging_server.h',
144         'runtime/browser/devtools/xwalk_devtools_delegate.cc',
145         'runtime/browser/devtools/xwalk_devtools_delegate.h',
146         'runtime/browser/geolocation/tizen/location_provider_tizen.cc',
147         'runtime/browser/geolocation/tizen/location_provider_tizen.h',
148         'runtime/browser/geolocation/xwalk_access_token_store.cc',
149         'runtime/browser/geolocation/xwalk_access_token_store.h',
150         'runtime/browser/image_util.cc',
151         'runtime/browser/image_util.h',
152         'runtime/browser/media/media_capture_devices_dispatcher.cc',
153         'runtime/browser/media/media_capture_devices_dispatcher.h',
154         'runtime/browser/renderer_host/pepper/xwalk_browser_pepper_host_factory.cc',
155         'runtime/browser/renderer_host/pepper/xwalk_browser_pepper_host_factory.h',
156         'runtime/browser/runtime.cc',
157         'runtime/browser/runtime.h',
158         'runtime/browser/runtime_context.cc',
159         'runtime/browser/runtime_context.h',
160         'runtime/browser/runtime_download_manager_delegate.cc',
161         'runtime/browser/runtime_download_manager_delegate.h',
162         'runtime/browser/runtime_file_select_helper.cc',
163         'runtime/browser/runtime_file_select_helper.h',
164         'runtime/browser/runtime_geolocation_permission_context.cc',
165         'runtime/browser/runtime_geolocation_permission_context.h',
166         'runtime/browser/runtime_javascript_dialog_manager.cc',
167         'runtime/browser/runtime_javascript_dialog_manager.h',
168         'runtime/browser/runtime_network_delegate.cc',
169         'runtime/browser/runtime_network_delegate.h',
170         'runtime/browser/runtime_platform_util.h',
171         'runtime/browser/runtime_platform_util_android.cc',
172         'runtime/browser/runtime_platform_util_aura.cc',
173         'runtime/browser/runtime_platform_util_linux.cc',
174         'runtime/browser/runtime_platform_util_mac.mm',
175         'runtime/browser/runtime_platform_util_tizen.cc',
176         'runtime/browser/runtime_platform_util_win.cc',
177         'runtime/browser/runtime_quota_permission_context.cc',
178         'runtime/browser/runtime_quota_permission_context.h',
179         'runtime/browser/runtime_resource_dispatcher_host_delegate.cc',
180         'runtime/browser/runtime_resource_dispatcher_host_delegate.h',
181         'runtime/browser/runtime_resource_dispatcher_host_delegate_android.cc',
182         'runtime/browser/runtime_resource_dispatcher_host_delegate_android.h',
183         'runtime/browser/runtime_select_file_policy.cc',
184         'runtime/browser/runtime_select_file_policy.h',
185         'runtime/browser/runtime_url_request_context_getter.cc',
186         'runtime/browser/runtime_url_request_context_getter.h',
187         'runtime/browser/speech/speech_recognition_manager_delegate.cc',
188         'runtime/browser/speech/speech_recognition_manager_delegate.h',
189         'runtime/browser/sysapps_component.cc',
190         'runtime/browser/sysapps_component.h',
191         'runtime/browser/storage_component.cc',
192         'runtime/browser/storage_component.h',
193         'runtime/browser/ui/color_chooser.cc',
194         'runtime/browser/ui/color_chooser.h',
195         'runtime/browser/ui/color_chooser_android.cc',
196         'runtime/browser/ui/color_chooser_aura.cc',
197         'runtime/browser/ui/color_chooser_mac.cc',
198         'runtime/browser/ui/native_app_window.cc',
199         'runtime/browser/ui/native_app_window.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_main_parts.cc',
220         'runtime/browser/xwalk_browser_main_parts.h',
221         'runtime/browser/xwalk_browser_main_parts_android.cc',
222         'runtime/browser/xwalk_browser_main_parts_android.h',
223         'runtime/browser/xwalk_browser_main_parts_mac.h',
224         'runtime/browser/xwalk_browser_main_parts_mac.mm',
225         'runtime/browser/xwalk_browser_main_parts_tizen.cc',
226         'runtime/browser/xwalk_browser_main_parts_tizen.h',
227         'runtime/browser/xwalk_component.h',
228         'runtime/browser/xwalk_content_browser_client.cc',
229         'runtime/browser/xwalk_content_browser_client.h',
230         'runtime/browser/xwalk_render_message_filter.cc',
231         'runtime/browser/xwalk_render_message_filter.h',
232         'runtime/browser/xwalk_runner.cc',
233         'runtime/browser/xwalk_runner.h',
234         'runtime/browser/xwalk_runner_android.cc',
235         'runtime/browser/xwalk_runner_android.h',
236         'runtime/browser/xwalk_runner_tizen.cc',
237         'runtime/browser/xwalk_runner_tizen.h',
238         'runtime/common/android/xwalk_globals_android.cc',
239         'runtime/common/android/xwalk_globals_android.h',
240         'runtime/common/android/xwalk_hit_test_data.cc',
241         'runtime/common/android/xwalk_hit_test_data.h',
242         'runtime/common/android/xwalk_message_generator.cc',
243         'runtime/common/android/xwalk_message_generator.h',
244         'runtime/common/android/xwalk_render_view_messages.cc',
245         'runtime/common/android/xwalk_render_view_messages.h',
246         'runtime/common/paths_mac.h',
247         'runtime/common/paths_mac.mm',
248         'runtime/common/xwalk_common_messages.cc',
249         'runtime/common/xwalk_common_messages.h',
250         'runtime/common/xwalk_common_message_generator.cc',
251         'runtime/common/xwalk_common_message_generator.h',
252         'runtime/common/xwalk_content_client.cc',
253         'runtime/common/xwalk_content_client.h',
254         'runtime/common/xwalk_localized_error.cc',
255         'runtime/common/xwalk_localized_error.h',
256         'runtime/common/xwalk_paths.cc',
257         'runtime/common/xwalk_paths.h',
258         'runtime/common/xwalk_runtime_features.cc',
259         'runtime/common/xwalk_runtime_features.h',
260         'runtime/common/xwalk_switches.cc',
261         'runtime/common/xwalk_switches.h',
262         'runtime/common/xwalk_system_locale.cc',
263         'runtime/common/xwalk_system_locale.h',
264         'runtime/renderer/android/xwalk_render_process_observer.cc',
265         'runtime/renderer/android/xwalk_render_process_observer.h',
266         'runtime/renderer/android/xwalk_permission_client.cc',
267         'runtime/renderer/android/xwalk_permission_client.h',
268         'runtime/renderer/android/xwalk_render_view_ext.cc',
269         'runtime/renderer/android/xwalk_render_view_ext.h',
270         'runtime/renderer/isolated_file_system.cc',
271         'runtime/renderer/isolated_file_system.h',
272         'runtime/renderer/pepper/pepper_helper.cc',
273         'runtime/renderer/pepper/pepper_helper.h',
274         'runtime/renderer/pepper/pepper_uma_host.cc',
275         'runtime/renderer/pepper/pepper_uma_host.h',
276         'runtime/renderer/pepper/xwalk_renderer_pepper_host_factory.cc',
277         'runtime/renderer/pepper/xwalk_renderer_pepper_host_factory.h',
278         'runtime/renderer/tizen/xwalk_content_renderer_client_tizen.cc',
279         'runtime/renderer/tizen/xwalk_content_renderer_client_tizen.h',
280         'runtime/renderer/tizen/xwalk_render_view_ext_tizen.cc',
281         'runtime/renderer/tizen/xwalk_render_view_ext_tizen.h',
282         'runtime/renderer/xwalk_content_renderer_client.cc',
283         'runtime/renderer/xwalk_content_renderer_client.h',
284         'runtime/renderer/xwalk_render_process_observer_generic.cc',
285         'runtime/renderer/xwalk_render_process_observer_generic.h',
286       ],
287       'includes': [
288         'xwalk_jsapi.gypi',
289       ],
290       'msvs_settings': {
291         'VCLinkerTool': {
292           'SubSystem': '2',  # Set /SUBSYSTEM:WINDOWS
293         },
294       },
295       'conditions': [
296         ['tizen==1', {
297           'dependencies': [
298             '../content/app/resources/content_resources.gyp:content_resources',
299             'build/system.gyp:tizen_geolocation',
300             'sysapps/sysapps_resources.gyp:xwalk_sysapps_resources',
301             'tizen/xwalk_tizen.gypi:xwalk_tizen_lib',
302             '<(DEPTH)/third_party/jsoncpp/jsoncpp.gyp:jsoncpp',
303           ],
304           'cflags': [
305             '<!@(pkg-config --cflags libtzplatform-config)',
306           ],
307           'link_settings': {
308             'libraries': [
309               '<!@(pkg-config --libs libtzplatform-config)',
310             ],
311           },
312           'sources': [
313             'experimental/native_file_system/virtual_root_provider_tizen.cc',
314             'runtime/browser/tizen/tizen_locale_listener.cc',
315             'runtime/browser/tizen/tizen_locale_listener.h',
316           ],
317           'sources!':[
318             'runtime/browser/runtime_platform_util_linux.cc',
319           ],
320         }],
321         ['OS=="android"',{
322           'dependencies':[
323             'xwalk_core_jar_jni',
324             'xwalk_core_native_jni',
325           ],
326           'sources': [
327             'experimental/native_file_system/virtual_root_provider_android.cc',
328           ],
329           'sources!':[
330             'runtime/renderer/xwalk_render_process_observer_generic.cc',
331             'runtime/renderer/xwalk_render_process_observer_generic.h',
332           ],
333         }],
334         ['OS=="win" and win_use_allocator_shim==1', {
335           'dependencies': [
336             '../base/allocator/allocator.gyp:allocator',
337           ],
338         }],
339         ['OS=="win"', {
340           'resource_include_dirs': [
341             '<(SHARED_INTERMEDIATE_DIR)/webkit',
342           ],
343           'configurations': {
344             'Debug_Base': {
345               'msvs_settings': {
346                 'VCLinkerTool': {
347                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
348                 },
349               },
350             },
351           },
352           # TODO(jschuh): crbug.com/167187 fix size_t to int truncations.
353           'msvs_disabled_warnings': [ 4267, ],
354         }],  # OS=="win"
355         ['OS=="linux"', {
356           'dependencies': [
357             '../build/linux/system.gyp:fontconfig',
358             '../build/linux/system.gyp:dbus',
359           ],
360           'sources': [
361             'experimental/native_file_system/virtual_root_provider_linux.cc',
362           ]
363         }],  # OS=="linux"
364         ['os_posix==1 and OS != "mac" and use_allocator=="tcmalloc"', {
365           'dependencies': [
366             # This is needed by content/app/content_main_runner.cc
367             '../base/allocator/allocator.gyp:allocator',
368           ],
369         }],  # os_posix==1 and OS != "mac" and use_allocator=="tcmalloc"
370         ['use_custom_freetype==1', {
371           'dependencies': [
372              '../third_party/freetype2/freetype2.gyp:freetype2',
373           ],
374         }],  # use_custom_freetype==1
375         ['toolkit_views==1', {
376           'dependencies': [
377             '../ui/strings/ui_strings.gyp:ui_strings',
378             '../ui/views/controls/webview/webview.gyp:webview',
379             '../ui/views/views.gyp:views',
380             '../ui/views/views.gyp:views_test_support',
381             '../ui/resources/ui_resources.gyp:ui_resources',
382           ],
383         }],  # toolkit_views==1
384         ['use_aura==1', {
385           'dependencies': [
386             '../ui/aura/aura.gyp:aura',
387           ],
388         }, {  # use_aura==0
389           'sources/': [
390             ['exclude', '_aura\\.cc$'],
391           ],
392         }],
393         ['disable_nacl==0', {
394             'conditions': [
395                 ['OS=="linux"', {
396                   'sources': [
397                     'runtime/browser/nacl_host/nacl_browser_delegate_impl.cc',
398                     'runtime/browser/nacl_host/nacl_browser_delegate_impl.h',
399                   ],
400                   'dependencies': [
401                     '../components/nacl.gyp:nacl',
402                     '../components/nacl.gyp:nacl_browser',
403                     '../components/nacl.gyp:nacl_common',
404                     '../components/nacl.gyp:nacl_renderer',
405                     '../components/nacl.gyp:nacl_helper',
406                     '../components/nacl.gyp:nacl_linux',
407                     '../native_client/src/trusted/service_runtime/linux/nacl_bootstrap.gyp:nacl_helper_bootstrap',
408                     '../ppapi/native_client/src/trusted/plugin/plugin.gyp:nacl_trusted_plugin',
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/app/resources/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)/content/app/resources/content_resources_100_percent.pak',
495               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
496               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
497               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/app_locale_settings_en-US.pak',
498               '<(SHARED_INTERMEDIATE_DIR)/ui/strings/ui_strings_en-US.pak',
499               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
500               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
501               '<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_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/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           'configurations': {
586             'Debug_Base': {
587               'msvs_settings': {
588                 'VCLinkerTool': {
589                   'LinkIncremental': '<(msvs_large_module_debug_link_mode)',
590                 },
591               },
592             },
593           },
594         }],  # OS=="win"
595         ['OS == "win"', {
596           'dependencies': [
597             '../sandbox/sandbox.gyp:sandbox',
598           ],
599         }],  # OS=="win"
600         ['OS=="mac"', {
601           'product_name': '<(xwalk_product_name)',
602           'dependencies!': [
603             'xwalk_runtime',
604           ],
605           'dependencies': [
606             'xwalk_framework',
607             'xwalk_helper_app',
608           ],
609           'copies': [
610             {
611               'destination': '<(PRODUCT_DIR)/<(xwalk_product_name).app/Contents/Frameworks',
612               'files': [
613                 '<(PRODUCT_DIR)/<(xwalk_product_name) Helper.app',
614               ],
615             },
616           ],
617           'postbuilds': [
618             {
619               'postbuild_name': 'Copy <(xwalk_product_name) Framework.framework',
620               'action': [
621                 '../build/mac/copy_framework_unversioned.sh',
622                 '${BUILT_PRODUCTS_DIR}/<(xwalk_product_name) Framework.framework',
623                 '${BUILT_PRODUCTS_DIR}/${CONTENTS_FOLDER_PATH}/Frameworks',
624               ],
625             },
626             {
627               'postbuild_name': 'Fix Framework Link',
628               'action': [
629                 'install_name_tool',
630                 '-change',
631                 '/Library/Frameworks/<(xwalk_product_name) Framework.framework/Versions/A/<(xwalk_product_name) Framework',
632                 '@executable_path/../Frameworks/<(xwalk_product_name) Framework.framework/<(xwalk_product_name) Framework',
633                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
634               ],
635             },
636             {
637               # Modify the Info.plist as needed.
638               'postbuild_name': 'Tweak Info.plist',
639               'action': ['../build/mac/tweak_info_plist.py',
640                          '--scm=1',
641                          '--version=<(xwalk_version)'],
642             },
643             {
644               # This postbuid step is responsible for creating the following
645               # helpers:
646               #
647               # XWalk Helper EH.app and XWalk Helper NP.app are
648               # created from XWalk Helper.app.
649               #
650               # The EH helper is marked for an executable heap. The NP helper
651               # is marked for no PIE (ASLR).
652               'postbuild_name': 'Make More Helpers',
653               'action': [
654                 '../build/mac/make_more_helpers.sh',
655                 'Frameworks',
656                 '<(xwalk_product_name)',
657               ],
658             },
659             {
660               # Make sure there isn't any Objective-C in the xwalk's
661               # executable.
662               'postbuild_name': 'Verify No Objective-C',
663               'action': [
664                 '../build/mac/verify_no_objc.sh',
665               ],
666             },
667           ],
668         }],  # OS=="mac"
669       ],
670     },
671     {
672       'target_name': 'xwalk_builder',
673       'type': 'none',
674       'conditions': [
675         ['OS!="android"', {
676           'dependencies': [
677             'xwalk',
678             'xwalk_all_tests',
679           ],
680         },
681         {
682           'dependencies': [
683             # For internal testing.
684             'xwalk_core_internal_shell_apk',
685             'xwalk_core_internal_test_apk',
686             'xwalk_core_shell_apk',
687             'xwalk_core_test_apk',
688             'xwalk_runtime_client_embedded_shell_apk',
689             'xwalk_runtime_client_embedded_test_apk',
690             'xwalk_runtime_client_shell_apk',
691             'xwalk_runtime_client_test_apk',
692
693             # For external testing.
694             'pack_xwalk_core_library',
695             'xwalk_core_library_documentation',
696             'xwalk_runtime_lib_apk',
697             'xwalk_app_hello_world_apk',
698             'xwalk_app_template',
699             'xwalk_core_sample_apk',
700             'xwalk_core_library_aar',
701             'xwalk_packaging_tool_test',
702           ],
703         }],
704       ],
705     },
706   ], # targets
707   'conditions': [
708     ['OS=="linux"', {
709       'includes': [ 'extensions/xesh/xesh.gypi' ],
710     }],
711     ['OS=="mac"', {
712       'targets': [
713         {
714           'target_name': 'xwalk_framework',
715           'type': 'shared_library',
716           'product_name': '<(xwalk_product_name) Framework',
717           'mac_bundle': 1,
718           'mac_bundle_resources': [
719             'runtime/app/English.lproj/MainMenu.xib',
720             '<(PRODUCT_DIR)/xwalk.pak'
721           ],
722           'dependencies': [
723             'xwalk_runtime',
724           ],
725           'include_dirs': [
726             '..',
727           ],
728           'sources': [
729             'runtime/app/xwalk_content_main.cc',
730             'runtime/app/xwalk_content_main.h',
731           ],
732           'copies': [
733             {
734               # Copy FFmpeg binaries for audio/video support.
735               'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
736               'files': [
737                 '<(PRODUCT_DIR)/ffmpegsumo.so',
738               ],
739             },
740           ],
741           'conditions': [
742             ['enable_webrtc==1', {
743               'variables': {
744                 'libpeer_target_type%': 'static_library',
745               },
746               'conditions': [
747                 ['libpeer_target_type!="static_library"', {
748                   'copies': [{
749                    'destination': '<(PRODUCT_DIR)/$(CONTENTS_FOLDER_PATH)/Libraries',
750                    'files': [
751                       '<(PRODUCT_DIR)/libpeerconnection.so',
752                     ],
753                   }],
754                 }],
755               ],
756             }],
757             ['icu_use_data_file_flag==1', {
758               'mac_bundle_resources': [
759                 '<(PRODUCT_DIR)/icudtl.dat',
760               ],
761             }],
762           ],
763         },  # target xwalk_framework
764         {
765           'target_name': 'xwalk_helper_app',
766           'type': 'executable',
767           'variables': { 'enable_wexit_time_destructors': 1, },
768           'product_name': '<(xwalk_product_name) Helper',
769           'mac_bundle': 1,
770           'dependencies': [
771             'xwalk_framework',
772           ],
773           'sources': [
774             'runtime/app/xwalk_main.cc',
775             'runtime/app/helper-Info.plist',
776           ],
777           # TODO(mark): Come up with a fancier way to do this.  It should only
778           # be necessary to list helper-Info.plist once, not the three times it
779           # is listed here.
780           'mac_bundle_resources!': [
781             'runtime/app/helper-Info.plist',
782           ],
783           # TODO(mark): For now, don't put any resources into this app.  Its
784           # resources directory will be a symbolic link to the browser app's
785           # resources directory.
786           'mac_bundle_resources/': [
787             ['exclude', '.*'],
788           ],
789           'xcode_settings': {
790             'INFOPLIST_FILE': 'runtime/app/helper-Info.plist',
791           },
792           'postbuilds': [
793             {
794               # The framework defines its load-time path
795               # (DYLIB_INSTALL_NAME_BASE) relative to the main executable
796               # (chrome).  A different relative path needs to be used in
797               # xwalk_helper_app.
798               'postbuild_name': 'Fix Framework Link',
799               'action': [
800                 'install_name_tool',
801                 '-change',
802                 '/Library/Frameworks/<(xwalk_product_name) Framework.framework/Versions/A/<(xwalk_product_name) Framework',
803                 '@executable_path/../../../../Frameworks/<(xwalk_product_name) Framework.framework/<(xwalk_product_name) Framework',
804                 '${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}'
805               ],
806             },
807             {
808               # Modify the Info.plist as needed.  The script explains why this
809               # is needed.  This is also done in the chrome and chrome_dll
810               # targets.  In this case, --breakpad=0, --keystone=0, and --scm=0
811               # are used because Breakpad, Keystone, and SCM keys are
812               # never placed into the helper.
813               'postbuild_name': 'Tweak Info.plist',
814               'action': ['../build/mac/tweak_info_plist.py',
815                          '--breakpad=0',
816                          '--keystone=0',
817                          '--scm=0',
818                          '--version=<(xwalk_version)'],
819             },
820             {
821               # Make sure there isn't any Objective-C in the helper app's
822               # executable.
823               'postbuild_name': 'Verify No Objective-C',
824               'action': [
825                 '../build/mac/verify_no_objc.sh',
826               ],
827             },
828           ],
829           'conditions': [
830             ['component=="shared_library"', {
831               'xcode_settings': {
832                 'LD_RUNPATH_SEARCH_PATHS': [
833                   # Get back from XWalk.app/Contents/Frameworks/
834                   #                                 Helper.app/Contents/MacOS
835                   '@loader_path/../../../../../..',
836                 ],
837               },
838             }],
839           ],
840         },  # target xwalk_helper_app
841       ],
842     }],  # OS=="mac"
843     ['OS=="android"', {
844       'variables': {
845         'variables': {
846           'conditions': [
847             ['android_app_abi=="x86"', {
848               'version_code_shift%': 1,
849             }],
850             ['android_app_abi=="armeabi-v7a"', {
851               'version_code_shift%': 2,
852             }],
853             ['android_app_abi=="armeabi"', {
854               'version_code_shift%': 3,
855             }],
856           ], # conditions
857         },
858         'version_code_shift%': '<(version_code_shift)',
859         'xwalk_version_code': '<!(python tools/build/android/generate_version_code.py -f VERSION -s <(version_code_shift))',
860       },
861       'includes': [
862         'xwalk_android.gypi',
863         'xwalk_android_tests.gypi',
864         'xwalk_android_app.gypi',
865         'xwalk_core_library_android.gypi',
866       ],
867       'targets': [
868       {
869         'target_name': 'All',
870         'type': 'none',
871         'dependencies': [
872           'xwalk',
873         ],
874       }, # target_name: All
875     ],  # targets
876     }], # OS=="android"
877   ]
878 }