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