Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / android_webview / android_webview.gyp
blob9a390f908eb72d2e19396bb351032e1569a80663
1 # Copyright 2009 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file.
5   'variables': {
6     'chromium_code': 1,
7   },
8   'targets': [
9     {
10       'target_name': 'android_webview_pak',
11       'type': 'none',
12       'dependencies': [
13         '<(DEPTH)/content/app/resources/content_resources.gyp:content_resources',
14         '<(DEPTH)/net/net.gyp:net_resources',
15         '<(DEPTH)/third_party/WebKit/public/blink_resources.gyp:blink_resources',
16         '<(DEPTH)/ui/resources/ui_resources.gyp:ui_resources',
17       ],
18       'variables': {
19         'conditions': [
20           ['target_arch=="arm" or target_arch=="ia32" or target_arch=="mipsel"', {
21             'arch_suffix':'32'
22           }],
23           ['target_arch=="arm64" or target_arch=="x64" or target_arch=="mips64el"', {
24             'arch_suffix':'64'
25           }],
26         ],
27         'grit_out_dir': '<(SHARED_INTERMEDIATE_DIR)/android_webview',
28       },
29       'actions': [
30         {
31           'action_name': 'generate_aw_resources',
32           'variables': {
33             'grit_grd_file': 'ui/aw_resources.grd',
34           },
35           'includes': [ '../build/grit_action.gypi' ],
36         },
37         {
38           'action_name': 'repack_android_webview_pack',
39           'variables': {
40             'pak_inputs': [
41               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_resources.pak',
42               '<(SHARED_INTERMEDIATE_DIR)/blink/public/resources/blink_image_resources_100_percent.pak',
43               '<(SHARED_INTERMEDIATE_DIR)/content/app/resources/content_resources_100_percent.pak',
44               '<(SHARED_INTERMEDIATE_DIR)/content/content_resources.pak',
45               '<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
46               '<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
47               '<(grit_out_dir)/aw_resources.pak',
48             ],
49             'pak_output': '<(PRODUCT_DIR)/android_webview_assets/webviewchromium.pak',
50           },
51          'includes': [ '../build/repack_action.gypi' ],
52         },
53         {
54           'action_name': 'generate_aw_strings',
55           'variables': {
56             'grit_grd_file': 'ui/aw_strings.grd',
57           },
58           'includes': [ '../build/grit_action.gypi' ],
59         },
60         {
61           'action_name': 'android_webview_repack_locales',
62           'variables': {
63             'repack_locales': 'tools/webview_repack_locales.py',
64           },
65           'inputs': [
66             '<(repack_locales)',
67             '<!@pymod_do_main(webview_repack_locales -i -p <(PRODUCT_DIR) -s <(SHARED_INTERMEDIATE_DIR) <(locales))'
68           ],
69           'outputs': [
70             '<!@pymod_do_main(webview_repack_locales -o -p <(PRODUCT_DIR) -s <(SHARED_INTERMEDIATE_DIR) <(locales))'
71           ],
72           'action': [
73             'python',
74             '<(repack_locales)',
75             '-p', '<(PRODUCT_DIR)',
76             '-s', '<(SHARED_INTERMEDIATE_DIR)',
77             '<@(locales)',
78           ],
79         },
80         {
81           'action_name': 'rename_snapshot_blob',
82           'inputs': [
83             '<(PRODUCT_DIR)/snapshot_blob.bin',
84           ],
85           'outputs': [
86             '<(PRODUCT_DIR)/snapshot_blob_<(arch_suffix).bin',
87           ],
88           'action': [
89             'python',
90             '<(DEPTH)/build/cp.py',
91             '<@(_inputs)',
92             '<@(_outputs)',
93           ],
94         },
95         {
96           'action_name': 'rename_natives_blob',
97           'inputs': [
98             '<(PRODUCT_DIR)/natives_blob.bin',
99           ],
100           'outputs': [
101             '<(PRODUCT_DIR)/natives_blob_<(arch_suffix).bin',
102           ],
103           'action': [
104             'python',
105             '<(DEPTH)/build/cp.py',
106             '<@(_inputs)',
107             '<@(_outputs)',
108           ],
109         },
110       ],
111     },
112     {
113       'target_name': 'android_webview_locale_paks',
114       'type': 'none',
115       'variables': {
116         'locale_pak_files': [ '<@(webview_locales_input_paks)' ],
117       },
118       'includes': [
119         'apk/system_webview_locales_paks.gypi',
120         '../build/android/locale_pak_resources.gypi',
121       ],
122     },
123     {
124       'target_name': 'android_webview_strings_grd',
125       'android_unmangled_name': 1,
126       'type': 'none',
127       'variables': {
128         'grd_file': '../android_webview/java/strings/android_webview_strings.grd',
129       },
130       'includes': [
131           '../build/java_strings_grd.gypi',
132       ],
133     },
134     {
135       'target_name': 'android_webview_version',
136       'type': 'none',
137       'direct_dependent_settings': {
138         'include_dirs': [
139           '<(SHARED_INTERMEDIATE_DIR)',
140         ],
141       },
142       # Because generate_version generates a header, we must set the
143       # hard_dependency flag.
144       'hard_dependency': 1,
145       'actions': [
146         {
147           'action_name': 'generate_version',
148           'includes': [
149             '../build/util/version.gypi',
150           ],
151           'variables': {
152             'template_input_path': 'common/aw_version_info_values.h.version',
153           },
154           'inputs': [
155             '<(version_py_path)',
156             '<(template_input_path)',
157             '<(version_path)',
158             '<(lastchange_path)',
159           ],
160           'outputs': [
161             '<(SHARED_INTERMEDIATE_DIR)/android_webview/common/aw_version_info_values.h',
162           ],
163           'action': [
164             'python',
165             '<(version_py_path)',
166             '-f', '<(version_path)',
167             '-f', '<(lastchange_path)',
168             '<(template_input_path)',
169             '<@(_outputs)',
170           ],
171           'message': 'Generating version information',
172         },
173       ],
174     },
175     {
176       'target_name': 'android_webview_common',
177       'type': 'static_library',
178       'dependencies': [
179         '../android_webview/native/webview_native.gyp:webview_native',
180         '../cc/cc.gyp:cc_surfaces',
181         '../components/components.gyp:auto_login_parser',
182         '../components/components.gyp:autofill_content_renderer',
183         '../components/components.gyp:breakpad_host',
184         '../components/components.gyp:cdm_browser',
185         '../components/components.gyp:cdm_renderer',
186         '../components/components.gyp:crash_component',
187         '../components/components.gyp:data_reduction_proxy_core_browser',
188         '../components/components.gyp:devtools_discovery',
189         '../components/components.gyp:navigation_interception',
190         '../components/components.gyp:printing_common',
191         '../components/components.gyp:printing_browser',
192         '../components/components.gyp:printing_renderer',
193         '../components/components.gyp:visitedlink_browser',
194         '../components/components.gyp:visitedlink_renderer',
195         '../components/components.gyp:web_contents_delegate_android',
196         '../content/content.gyp:content_app_both',
197         '../content/content.gyp:content_browser',
198         '../gin/gin.gyp:gin',
199         '../gpu/blink/gpu_blink.gyp:gpu_blink',
200         '../gpu/command_buffer/command_buffer.gyp:gles2_utils',
201         '../gpu/gpu.gyp:command_buffer_service',
202         '../gpu/gpu.gyp:gl_in_process_context',
203         '../gpu/gpu.gyp:gles2_c_lib',
204         '../gpu/gpu.gyp:gles2_implementation',
205         '../gpu/skia_bindings/skia_bindings.gyp:gpu_skia_bindings',
206         '../media/media.gyp:media',
207         '../media/midi/midi.gyp:midi',
208         '../printing/printing.gyp:printing',
209         '../skia/skia.gyp:skia',
210         '../third_party/WebKit/public/blink.gyp:blink',
211         '../ui/events/events.gyp:gesture_detection',
212         '../ui/gl/gl.gyp:gl',
213         '../ui/shell_dialogs/shell_dialogs.gyp:shell_dialogs',
214         '../v8/tools/gyp/v8.gyp:v8',
215         'android_webview_pak',
216         'android_webview_version',
217         '../components/components.gyp:policy',
218         '../components/components.gyp:policy_component',
219         '../components/components.gyp:pref_registry',
220         '../components/url_formatter/url_formatter.gyp:url_formatter',
221       ],
222       'include_dirs': [
223         '..',
224         '../skia/config',
225         '<(SHARED_INTERMEDIATE_DIR)/ui/resources/',
226       ],
227       'sources': [
228         'browser/aw_browser_context.cc',
229         'browser/aw_browser_context.h',
230         'browser/aw_browser_main_parts.cc',
231         'browser/aw_browser_main_parts.h',
232         'browser/aw_browser_permission_request_delegate.h',
233         'browser/aw_browser_policy_connector.cc',
234         'browser/aw_browser_policy_connector.h',
235         'browser/aw_contents_client_bridge_base.cc',
236         'browser/aw_contents_client_bridge_base.h',
237         'browser/aw_content_browser_client.cc',
238         'browser/aw_content_browser_client.h',
239         'browser/aw_contents_io_thread_client.h',
240         'browser/aw_cookie_access_policy.cc',
241         'browser/aw_cookie_access_policy.h',
242         'browser/aw_dev_tools_discovery_provider.cc',
243         'browser/aw_dev_tools_discovery_provider.h',
244         'browser/aw_download_manager_delegate.cc',
245         'browser/aw_download_manager_delegate.h',
246         'browser/aw_form_database_service.cc',
247         'browser/aw_form_database_service.h',
248         'browser/aw_gl_surface.cc',
249         'browser/aw_gl_surface.h',
250         'browser/aw_http_auth_handler_base.cc',
251         'browser/aw_http_auth_handler_base.h',
252         'browser/aw_javascript_dialog_manager.cc',
253         'browser/aw_javascript_dialog_manager.h',
254         'browser/aw_locale_manager.h',
255         'browser/aw_login_delegate.cc',
256         'browser/aw_login_delegate.h',
257         'browser/aw_media_client_android.cc',
258         'browser/aw_media_client_android.h',
259         'browser/aw_message_port_message_filter.cc',
260         'browser/aw_message_port_message_filter.h',
261         'browser/aw_message_port_service.h',
262         'browser/aw_permission_manager.cc',
263         'browser/aw_permission_manager.h',
264         'browser/aw_pref_store.cc',
265         'browser/aw_pref_store.h',
266         'browser/aw_print_manager.cc',
267         'browser/aw_print_manager.h',
268         'browser/aw_printing_message_filter.cc',
269         'browser/aw_printing_message_filter.h',
270         'browser/aw_quota_manager_bridge.cc',
271         'browser/aw_quota_manager_bridge.h',
272         'browser/aw_quota_permission_context.cc',
273         'browser/aw_quota_permission_context.h',
274         'browser/aw_render_thread_context_provider.cc',
275         'browser/aw_render_thread_context_provider.h',
276         'browser/aw_request_interceptor.cc',
277         'browser/aw_request_interceptor.h',
278         'browser/aw_resource_context.cc',
279         'browser/aw_resource_context.h',
280         'browser/aw_ssl_host_state_delegate.cc',
281         'browser/aw_ssl_host_state_delegate.h',
282         'browser/aw_result_codes.h',
283         'browser/aw_web_preferences_populater.cc',
284         'browser/aw_web_preferences_populater.h',
285         'browser/aw_web_resource_response.cc',
286         'browser/aw_web_resource_response.h',
287         'browser/browser_view_renderer.cc',
288         'browser/browser_view_renderer.h',
289         'browser/browser_view_renderer_client.h',
290         'browser/child_frame.cc',
291         'browser/child_frame.h',
292         'browser/deferred_gpu_command_service.cc',
293         'browser/deferred_gpu_command_service.h',
294         'browser/find_helper.cc',
295         'browser/find_helper.h',
296         'browser/hardware_renderer.cc',
297         'browser/hardware_renderer.h',
298         'browser/icon_helper.cc',
299         'browser/icon_helper.h',
300         'browser/input_stream.h',
301         'browser/jni_dependency_factory.h',
302         'browser/gl_view_renderer_manager.cc',
303         'browser/gl_view_renderer_manager.h',
304         'browser/net/android_stream_reader_url_request_job.cc',
305         'browser/net/android_stream_reader_url_request_job.h',
306         'browser/net/aw_http_user_agent_settings.h',
307         'browser/net/aw_http_user_agent_settings.cc',
308         'browser/net/aw_network_delegate.cc',
309         'browser/net/aw_network_delegate.h',
310         'browser/net/aw_url_request_context_getter.cc',
311         'browser/net/aw_url_request_context_getter.h',
312         'browser/net/aw_url_request_job_factory.cc',
313         'browser/net/aw_url_request_job_factory.h',
314         'browser/net_disk_cache_remover.cc',
315         'browser/net_disk_cache_remover.h',
316         'browser/net/init_native_callback.h',
317         'browser/net/input_stream_reader.cc',
318         'browser/net/input_stream_reader.h',
319         'browser/parent_compositor_draw_constraints.cc',
320         'browser/parent_compositor_draw_constraints.h',
321         'browser/parent_output_surface.cc',
322         'browser/parent_output_surface.h',
323         'browser/renderer_host/aw_render_view_host_ext.cc',
324         'browser/renderer_host/aw_render_view_host_ext.h',
325         'browser/renderer_host/aw_resource_dispatcher_host_delegate.cc',
326         'browser/renderer_host/aw_resource_dispatcher_host_delegate.h',
327         'browser/scoped_allow_wait_for_legacy_web_view_api.h',
328         'browser/scoped_app_gl_state_restore.cc',
329         'browser/scoped_app_gl_state_restore.h',
330         'browser/shared_renderer_state.cc',
331         'browser/shared_renderer_state.h',
332         'common/android_webview_message_generator.cc',
333         'common/android_webview_message_generator.h',
334         'common/aw_content_client.cc',
335         'common/aw_content_client.h',
336         'common/aw_descriptors.h',
337         'common/aw_hit_test_data.cc',
338         'common/aw_hit_test_data.h',
339         'common/aw_message_port_messages.h',
340         'common/aw_resource.h',
341         'common/aw_switches.cc',
342         'common/aw_switches.h',
343         'common/devtools_instrumentation.h',
344         'common/render_view_messages.cc',
345         'common/render_view_messages.h',
346         'common/url_constants.cc',
347         'common/url_constants.h',
348         'crash_reporter/aw_microdump_crash_reporter.cc',
349         'crash_reporter/aw_microdump_crash_reporter.h',
350         'lib/aw_browser_dependency_factory_impl.cc',
351         'lib/aw_browser_dependency_factory_impl.h',
352         'lib/main/aw_main_delegate.cc',
353         'lib/main/aw_main_delegate.h',
354         'lib/main/webview_jni_onload.cc',
355         'lib/main/webview_jni_onload.h',
356         'public/browser/draw_gl.h',
357         'renderer/aw_content_renderer_client.cc',
358         'renderer/aw_content_renderer_client.h',
359         'renderer/aw_content_settings_client.cc',
360         'renderer/aw_content_settings_client.h',
361         'renderer/aw_key_systems.cc',
362         'renderer/aw_key_systems.h',
363         'renderer/aw_message_port_client.cc',
364         'renderer/aw_message_port_client.h',
365         'renderer/aw_print_web_view_helper_delegate.cc',
366         'renderer/aw_print_web_view_helper_delegate.h',
367         'renderer/aw_render_process_observer.cc',
368         'renderer/aw_render_process_observer.h',
369         'renderer/aw_render_frame_ext.cc',
370         'renderer/aw_render_frame_ext.h',
371         'renderer/aw_render_view_ext.cc',
372         'renderer/aw_render_view_ext.h',
373         'renderer/print_render_frame_observer.cc',
374         'renderer/print_render_frame_observer.h',
375       ],
376     },
377     {
378       'target_name': 'libwebviewchromium',
379       'includes': [
380           'libwebviewchromium.gypi',
381       ],
382     },
383     {
384       'target_name': 'android_webview_java',
385       'type': 'none',
386       'dependencies': [
387         '../android_webview/native/webview_native.gyp:android_webview_aw_permission_request_resource',
388         '../components/components.gyp:external_video_surface_java',
389         '../components/components.gyp:navigation_interception_java',
390         '../components/components.gyp:policy_java',
391         '../components/components.gyp:web_contents_delegate_android_java',
392         '../content/content.gyp:content_java',
393         '../ui/android/ui_android.gyp:ui_java',
394         'android_webview_locale_paks',
395         'android_webview_strings_grd',
396       ],
397       'variables': {
398         'java_in_dir': '../android_webview/java',
399         'has_java_resources': 1,
400         'R_package': 'org.chromium.android_webview',
401         'R_package_relpath': 'org/chromium/android_webview',
402         'android_manifest_path': '../android_webview/apk/java/AndroidManifest.xml', # for lint
403       },
404       'includes': [ '../build/java.gypi' ],
405     },
406     {
407       'target_name': 'system_webview_glue_java',
408       'variables': {
409         'android_sdk_jar': '../third_party/android_platform/webview/frameworks_6.0.jar',
410         'java_in_dir': 'glue/java',
411       },
412       'includes': [ 'apk/system_webview_glue_common.gypi' ],
413     },
414     {
415       'target_name': 'system_webview_apk',
416       'dependencies': [
417         'system_webview_glue_java',
418       ],
419       'variables': {
420         'apk_name': 'SystemWebView',
421         'android_sdk_jar': '../third_party/android_platform/webview/frameworks_6.0.jar',
422         'java_in_dir': '../build/android/empty',
423         'resource_dir': 'apk/java/res',
424       },
425       'includes': [ 'apk/system_webview_apk_common.gypi' ],
426     },
427   ],
428   'includes': [
429     'android_webview_tests.gypi',
430   ],