Commit aefb2793 authored by hjd's avatar hjd Committed by Commit bot

Make the WebView apk build in the Chrome tree

We checkout the Android WebView glue layer (frameworks/webview)
into a new third_party directory (android_webview_glue)
which is checked out via gclient.

This is built against a jar containing frameworks/base
(in android_platform/webview/frameworks.jar).

We have to work around a few other issues:
    - Change build/java_apk.gypi to bypass the hardcoded
      'src' path.
    - Move libwebviewchromium to an include so we can make both
      the prefixed and un-prefixed version in the same build.

BUG=391488
R=mkosiba@chromium.org

Review URL: https://codereview.chromium.org/477903003

Cr-Commit-Position: refs/heads/master@{#293921}
parent b73e0783
......@@ -218,6 +218,7 @@ v8.log
/third_party/android_protobuf/src
/third_party/android_tools/
/third_party/android_tools_internal/
/third_party/android_webview_glue/src
/third_party/angle
/third_party/angle_dx11
/third_party/aosp
......
......@@ -468,6 +468,11 @@ deps_os = {
'src/third_party/android_protobuf/src':
Var('chromium_git') + '/external/android_protobuf.git' + '@' + '94f522f907e3f34f70d9e7816b947e62fddbb267',
# Whenever you roll this please also change frameworks/webview in
# src/android_webview/buildbot/aosp_manifest.xml to point to the same revision.
'src/third_party/android_webview_glue/src':
Var('chromium_git') + '/external/android_webview_glue.git' + '@' + 'e73e669ac73b2ddc042e380cd784ba8bd39ebb95',
'src/third_party/android_tools':
Var('chromium_git') + '/android_tools.git' + '@' + '7fc902d157a9aed7a2b68adc9c69181b3a43cd58',
......
......@@ -57,7 +57,7 @@ $(R_file_stamp): $(android_webview_resources_stamp)
include $(CLEAR_VARS)
LOCAL_MODULE := webviewchromium_pak
LOCAL_MODULE_STEM := webviewchromium
LOCAL_BUILT_MODULE_STEM := android_webview_apk/assets/webviewchromium.pak
LOCAL_BUILT_MODULE_STEM := android_webview_assets/webviewchromium.pak
include $(LOCAL_PATH)/webview_pak.mk
include $(CLEAR_VARS)
......
......@@ -6,69 +6,6 @@
'chromium_code': 1,
},
'targets': [
{
'target_name': 'libwebviewchromium',
'type': 'shared_library',
'android_unmangled_name': 1,
'dependencies': [
'android_webview_common',
],
'conditions': [
# Avoid clashes between the versions of this library built with
# android_webview_build==1 by using a different name prefix.
[ 'android_webview_build==0', {
'product_prefix': 'libstandalone',
}],
[ 'android_webview_build==1', {
# When building inside the android tree we also need to depend on all
# the java sources generated from templates which will be needed by
# android_webview_java in android_webview/java_library_common.mk.
'dependencies': [
'../base/base.gyp:base_java_application_state',
'../base/base.gyp:base_java_memory_pressure_level_list',
'../content/content.gyp:content_gamepad_mapping',
'../content/content.gyp:gesture_event_type_java',
'../content/content.gyp:page_transition_types_java',
'../content/content.gyp:popup_item_type_java',
'../content/content.gyp:result_codes_java',
'../content/content.gyp:screen_orientation_values_java',
'../content/content.gyp:selection_event_type_java',
'../content/content.gyp:speech_recognition_error_java',
'../media/media.gyp:media_android_imageformat_list',
'../net/net.gyp:cert_verify_status_android_java',
'../net/net.gyp:certificate_mime_types_java',
'../net/net.gyp:net_errors_java',
'../net/net.gyp:private_key_types_java',
'../ui/android/ui_android.gyp:bitmap_format_java',
'../ui/android/ui_android.gyp:window_open_disposition_java',
],
}],
[ 'android_webview_build==1 and use_system_skia==0', {
# When not using the system skia there are linker warnings about
# overriden hidden symbols which there's no easy way to eliminate;
# disable them. http://crbug.com/157326
'ldflags': [
'-Wl,--no-fatal-warnings',
],
'ldflags!': [
'-Wl,--fatal-warnings',
],
}],
['android_webview_build==1 and use_system_stlport==1', {
# ICU requires RTTI, which is not present in the system's stlport, so
# we have to include gabi++. We can't include it in icu.gyp because
# link_settings cannot be used inside target_conditions. This will be
# removed once we stop using the system stlport.
# http://crbug.com/409851
'libraries': [
'-lgabi++',
],
}],
],
'sources': [
'lib/main/webview_entry_point.cc',
],
},
{
'target_name': 'android_webview_pak',
'type': 'none',
......@@ -89,7 +26,7 @@
'<(SHARED_INTERMEDIATE_DIR)/net/net_resources.pak',
'<(SHARED_INTERMEDIATE_DIR)/ui/resources/ui_resources_100_percent.pak',
],
'pak_output': '<(PRODUCT_DIR)/android_webview_apk/assets/webviewchromium.pak',
'pak_output': '<(PRODUCT_DIR)/android_webview_assets/webviewchromium.pak',
},
'includes': [ '../build/repack_action.gypi' ],
},
......@@ -97,7 +34,7 @@
'action_name': 'add_en_US_pak_locale',
'variables': {
'pak_inputs': ['<(SHARED_INTERMEDIATE_DIR)/content/app/strings/content_strings_en-US.pak'],
'pak_output': '<(PRODUCT_DIR)/android_webview_apk/assets/en-US.pak',
'pak_output': '<(PRODUCT_DIR)/android_webview_assets/en-US.pak',
},
'includes': [ '../build/repack_action.gypi' ],
}
......@@ -277,11 +214,18 @@
'renderer/print_render_frame_observer.h',
],
},
{
'target_name': 'libwebviewchromium',
'includes': [
'libwebviewchromium.gypi',
],
}
],
'conditions': [
['android_webview_build==0', {
'includes': [
'android_webview_tests.gypi',
'../third_party/android_webview_glue/android_webview_glue.gypi',
],
'targets': [
{
......
......@@ -7,7 +7,7 @@
'target_name': 'android_webview_apk',
'type': 'none',
'dependencies': [
'libwebviewchromium',
'libstandalonelibwebviewchromium',
'android_webview_java',
'android_webview_pak',
'libdrawgl',
......@@ -20,8 +20,8 @@
'extensions_to_not_compress': 'pak',
'extra_native_libs': ['<(SHARED_LIB_DIR)/libdrawgl.>(android_product_extension)'],
'additional_input_paths': [
'<(PRODUCT_DIR)/android_webview_apk/assets/webviewchromium.pak',
'<(PRODUCT_DIR)/android_webview_apk/assets/en-US.pak',
'<(PRODUCT_DIR)/android_webview_assets/webviewchromium.pak',
'<(PRODUCT_DIR)/android_webview_assets/en-US.pak',
'<(PRODUCT_DIR)/android_webview_apk/assets/asset_file.html',
'<(PRODUCT_DIR)/android_webview_apk/assets/cookie_test.html',
'<(PRODUCT_DIR)/android_webview_apk/assets/asset_icon.png',
......@@ -39,6 +39,8 @@
{
'destination': '<(PRODUCT_DIR)/android_webview_apk/assets',
'files': [
'<(PRODUCT_DIR)/android_webview_assets/webviewchromium.pak',
'<(PRODUCT_DIR)/android_webview_assets/en-US.pak',
'<(java_in_dir)/assets/asset_file.html',
'<(java_in_dir)/assets/asset_icon.png',
'<(java_in_dir)/assets/cookie_test.html',
......@@ -176,5 +178,11 @@
'../android_webview/test/shell/src/draw_gl/draw_gl.cc',
],
},
{
'target_name': 'libstandalonelibwebviewchromium',
'includes': [
'libwebviewchromium.gypi',
],
},
],
}
......@@ -6,6 +6,8 @@
<default remote="aosp"
sync-j="6" />
<!-- Whenever you roll this please also change frameworks/webview in DEPS to point to the
same revision. -->
<project name="platform/frameworks/webview" path="frameworks/webview" revision="8dc9a9d1217f84a7f9b0554f22a826394eabc856"/>
<project groups="device,flo" name="device/asus/deb" revision="0ce3a783d549d023ddc553a04fed717ffb2ff533"/>
......
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'type': 'shared_library',
'android_unmangled_name': 1,
'dependencies': [
'android_webview_common',
],
'conditions': [
[ 'android_webview_build==1', {
# When building inside the android tree we also need to depend on all
# the java sources generated from templates which will be needed by
# android_webview_java in android_webview/java_library_common.mk.
'dependencies': [
'../base/base.gyp:base_java_application_state',
'../base/base.gyp:base_java_memory_pressure_level_list',
'../content/content.gyp:content_gamepad_mapping',
'../content/content.gyp:gesture_event_type_java',
'../content/content.gyp:page_transition_types_java',
'../content/content.gyp:popup_item_type_java',
'../content/content.gyp:result_codes_java',
'../content/content.gyp:screen_orientation_values_java',
'../content/content.gyp:selection_event_type_java',
'../content/content.gyp:speech_recognition_error_java',
'../media/media.gyp:media_android_imageformat_list',
'../net/net.gyp:cert_verify_status_android_java',
'../net/net.gyp:certificate_mime_types_java',
'../net/net.gyp:net_errors_java',
'../net/net.gyp:private_key_types_java',
'../ui/android/ui_android.gyp:bitmap_format_java',
'../ui/android/ui_android.gyp:window_open_disposition_java',
],
}],
[ 'android_webview_build==1 and use_system_skia==0', {
# When not using the system skia there are linker warnings about
# overriden hidden symbols which there's no easy way to eliminate;
# disable them. http://crbug.com/157326
'ldflags': [
'-Wl,--no-fatal-warnings',
],
'ldflags!': [
'-Wl,--fatal-warnings',
],
}],
['android_webview_build==1 and use_system_stlport==1', {
# ICU requires RTTI, which is not present in the system's stlport, so
# we have to include gabi++. We can't include it in icu.gyp because
# link_settings cannot be used inside target_conditions. This will be
# removed once we stop using the system stlport.
# http://crbug.com/409851
'libraries': [
'-lgabi++',
],
}],
],
'sources': [
'lib/main/webview_entry_point.cc',
],
}
......@@ -52,6 +52,7 @@
'<@(android_app_targets)',
'android_builder_tests',
'../android_webview/android_webview.gyp:android_webview_apk',
'../android_webview/android_webview.gyp:system_webview_apk',
'../android_webview/android_webview_telemetry_shell.gyp:android_webview_telemetry_shell_apk',
'../chrome/chrome.gyp:chrome_shell_apk',
'../chrome/chrome.gyp:chrome_sync_shell_apk',
......
......@@ -56,6 +56,9 @@
# code. This allows a test APK to inject a Linker.TestRunner instance at
# runtime. Should only be used by the chromium_linker_test_apk target!!
# never_lint - Set to 1 to not run lint on this target.
# java_in_dir_suffix - To override the /src suffix on java_in_dir.
# app_manifest_version_name - set the apps 'human readable' version number.
# app_manifest_version_code - set the apps version number.
{
'variables': {
'tested_apk_obfuscated_jar_path%': '/',
......@@ -99,6 +102,7 @@
'lint_result': '<(intermediate_dir)/lint_result.xml',
'lint_config': '<(intermediate_dir)/lint_config.xml',
'never_lint%': 0,
'java_in_dir_suffix%': '/src',
'instr_stamp': '<(intermediate_dir)/instr.stamp',
'jar_stamp': '<(intermediate_dir)/jar.stamp',
'obfuscate_stamp': '<(intermediate_dir)/obfuscate.stamp',
......@@ -605,7 +609,7 @@
# Java files instead of using find. (As is, this will be broken if two
# targets use the same java_in_dir and both use java_apk.gypi or
# both use java.gypi.)
'java_sources': ['>!@(find >(java_in_dir)/src >(additional_src_dirs) -name "*.java" # apk)'],
'java_sources': ['>!@(find >(java_in_dir)>(java_in_dir_suffix) >(additional_src_dirs) -name "*.java" # apk)'],
},
'inputs': [
......@@ -657,7 +661,7 @@
{
'variables': {
'src_dirs': [
'<(java_in_dir)/src',
'<(java_in_dir)<(java_in_dir_suffix)',
'>@(additional_src_dirs)',
],
'lint_jar_path': '<(jar_path)',
......
This diff is collapsed.
mkosiba@chromium.org
benm@chromium.org
torne@chromium.org
primiano@chromium.org
michaelbai@chromium.org
boliu@chromium.org
mnaganov@chromium.org
sgurun@chromium.org
hjd@chromium.org
Name: Android WebView Glue Layer
Short Name: android_webview_glue
Version: 0
URL: https://android.googlesource.com/platform/frameworks/webview
SOURCE CODE: git clone https://android.googlesource.com/platform/frameworks/webview.git
Security Critical: no
License: Apache Version 2.0
License File: NOT_SHIPPED
Description:
The AOSP Android WebView glue layer from frameworks/webview.
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'targets': [
{
'target_name': 'system_webview_apk',
'type': 'none',
'dependencies': [
'libwebviewchromium',
'android_webview_java',
'android_webview_pak',
],
'variables': {
'android_sdk_jar': '../third_party/android_platform/webview/frameworks.jar',
'apk_name': 'SystemWebView',
'app_manifest_version_code': '999999',
'java_in_dir': 'src/chromium',
'java_in_dir_suffix': '/java',
'native_lib_target': 'libwebviewchromium',
'never_lint': 1,
'resource_dir': 'src/chromium/res',
'R_package': 'com.android.webview.chromium',
'R_package_relpath': 'com/android/webview/chromium',
'extensions_to_not_compress': 'pak',
'asset_location': '<(PRODUCT_DIR)/android_webview_assets',
# TODO: crbug.com/405035 Find a better solution for WebView .pak files.
'additional_input_paths': [
'<(PRODUCT_DIR)/android_webview_assets/webviewchromium.pak',
'<(PRODUCT_DIR)/android_webview_assets/en-US.pak',
],
'conditions': [
['icu_use_data_file_flag==1', {
'additional_input_paths': [
'<(PRODUCT_DIR)/icudtl.dat',
],
}],
],
},
'copies': [
{
'destination': '<(PRODUCT_DIR)/android_webview_assets',
'files': [],
'conditions': [
['icu_use_data_file_flag==1', {
'files': [
'<(PRODUCT_DIR)/icudtl.dat',
],
}],
],
},
],'includes': [ '../../build/java_apk.gypi' ],
},
],
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment