Commit e01a8255 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

Leave WebLayer java string translations in language splits.

Create a separate WebView-w/o-WebLayer target,
SystemWebViewNoWebLayer.apk, which is used to define the java strings
which are held back from the language splits. This way, strings only
used by WebLayer (e.g. //components/browser_ui/strings) and not WebView
will be in language splits and the translations won't bloat
MonochromePublic.apk.

Bug: 1025256
Change-Id: I4f4f7c790b1d58738d8021a7972b77052a357303
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2047346
Auto-Submit: Evan Stade <estade@chromium.org>
Commit-Queue: Bo <boliu@chromium.org>
Reviewed-by: default avatarBo <boliu@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Reviewed-by: default avatarClark DuVall <cduvall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#741043}
parent 12a46252
......@@ -41,6 +41,14 @@ if (public_android_sdk) {
apk_name = "SystemWebView"
}
# This version of the WebView APK doesn't include WebLayer java and resources.
# It's used to define the whitelist of resources to be pulled out of language
# splits. See |shared_resources_whitelist_target|.
standalone_system_webview_apk_tmpl("system_webview_no_weblayer_apk") {
exclude_weblayer_java = true
apk_name = "SystemWebViewNoWebLayer"
}
if (enable_webview_bundles) {
standalone_system_webview_apk_tmpl("system_webview_base_bundle_module") {
target_type = "android_app_bundle_module"
......@@ -261,11 +269,7 @@ if (defined(android_secondary_abi_toolchain)) {
}
}
# Contains all Java dependencies used by WebView.
# TODO(crbug.com/934152): Rename this to android_webview_java. It has a
# temporary name because GN doesn't allow the direction
# of existing dependencies to be reversed.
java_group("android_webview_step1_java") {
java_group("android_webview_no_weblayer_java") {
deps = [
":browser_java",
......@@ -277,6 +281,11 @@ java_group("android_webview_step1_java") {
"//android_webview/nonembedded:nonembedded_java",
"//android_webview/support_library:support_lib_glue_java",
]
}
# Contains all Java dependencies used by WebView.
java_group("android_webview_java") {
deps = [ ":android_webview_no_weblayer_java" ]
if (webview_includes_weblayer) {
deps += [
......
......@@ -31,6 +31,8 @@ template("system_webview_apk_or_module_tmpl") {
_is_bundle_module = invoker.target_type == "android_app_bundle_module"
_target_type = invoker.target_type
}
_exclude_weblayer_java =
defined(invoker.exclude_weblayer_java) && invoker.exclude_weblayer_java
target(_target_type, target_name) {
forward_variables_from(invoker,
"*",
......@@ -41,11 +43,16 @@ template("system_webview_apk_or_module_tmpl") {
])
deps += [
"//android_webview:android_webview_step1_java",
"//android_webview:locale_pak_assets",
"//android_webview:pak_file_assets",
]
if (_exclude_weblayer_java) {
deps += [ "//android_webview:android_webview_no_weblayer_java" ]
} else {
deps += [ "//android_webview:android_webview_java" ]
}
target_sdk_version = android_sdk_version
product_config_java_packages = [ webview_product_config_java_package ]
......
......@@ -58,8 +58,8 @@ android_apk("webview_instrumentation_apk") {
":webview_instrumentation_apk_assets",
":webview_instrumentation_apk_resources",
":webview_instrumentation_test_utils_java",
"//android_webview:android_webview_java",
"//android_webview:android_webview_product_config_java",
"//android_webview:android_webview_step1_java",
"//android_webview:common_java",
"//android_webview:locale_pak_assets",
"//android_webview:platform_service_bridge_upstream_implementation_java",
......@@ -165,7 +165,7 @@ instrumentation_test_apk("webview_instrumentation_test_apk") {
min_sdk_version = 21
deps = [
":webview_instrumentation_test_utils_java",
"//android_webview:android_webview_step1_java",
"//android_webview:android_webview_java",
"//android_webview/test/embedded_test_server:aw_net_java_test_support",
"//base:base_java",
"//base:base_java_test_support",
......@@ -426,7 +426,7 @@ android_assets("android_webview_unittests_assets") {
android_library("android_webview_unittests_java") {
testonly = true
deps = [
"//android_webview:android_webview_step1_java",
"//android_webview:android_webview_java",
"//base:base_java",
"//content/public/test/android:content_java_test_support",
]
......@@ -455,7 +455,7 @@ junit_binary("android_webview_junit_tests") {
]
deps = [
"//android_webview:android_webview_step1_java",
"//android_webview:android_webview_java",
"//base:base_java_test_support",
"//content/public/test/android:content_java_test_support",
"//third_party/android_support_test_runner:runner_java",
......
......@@ -1662,7 +1662,7 @@ chrome_public_apk_or_module_tmpl("chrome_modern_public_base_bundle_module") {
android_library("monochrome_java") {
deps = [
"//android_webview:android_webview_step1_java",
"//android_webview:android_webview_java",
"//base:base_java",
"//chrome/android:chrome_java",
"//content/public/android:content_java",
......@@ -1770,7 +1770,9 @@ template("monochrome_public_apk_or_module_tmpl") {
if (public_android_sdk && !_is_trichrome) {
# Resource whitelist used when generating R.java files and causes
# only the webview subset of resources to be marked as non-final.
shared_resources_whitelist_target = "//android_webview:system_webview_apk"
# Strings in this target will also be kept in the base apk rather than placed in the language splits.
shared_resources_whitelist_target =
"//android_webview:system_webview_no_weblayer_apk"
# Ensure the localized resources for all locales are used, even when
# a smaller set is specified through aapt_locale_whitelist.
......
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