Commit 269e59a8 authored by Christopher Grant's avatar Christopher Grant Committed by Commit Bot

Android: Add Monochrome32 and Trichrome32 build targets

This change adds a pure 32-bit version of Monochrome and Trichrome to
the 64-bit build configuration. Building these targets generates a
product equivalent to building the targets on a 32-bit config. However,
by adding these, we have the option of building all Monochrome and
Trichrome products on a single 64-bit builder, and, we share the
compilation work (as opposed to the obsolete process of "APK merging"
parts from a 32-bit build into 64-bit products).

The targets added here are the public versions.

Bug: 1027573
Change-Id: Id5ffd698721077e8fffb1f8206adc0b7b1fce212
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1960575Reviewed-by: default avatarEric Stevenson <estevenson@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Commit-Queue: Christopher Grant <cjgrant@chromium.org>
Cr-Commit-Position: refs/heads/master@{#723897}
parent 95752771
......@@ -79,7 +79,25 @@ if (public_android_sdk) {
apk_name = "TrichromeWebView6432"
uncompress_dex = true
if (trichrome_synchronized_proguard) {
static_library_provider = "//chrome/android:trichrome_library_apk"
static_library_provider = "//chrome/android:trichrome_library_64_32_apk"
}
}
system_webview_apk_tmpl("trichrome_webview_32_apk") {
android_manifest = trichrome_webview_32_android_manifest
android_manifest_dep =
"//android_webview/nonembedded:trichrome_webview_32_manifest"
use_trichrome_library = true
is_64_bit_browser = false
include_64_bit_webview = false
min_sdk_version = 29
deps = upstream_only_webview_deps
apk_name = "TrichromeWebView32"
uncompress_dex = true
if (trichrome_synchronized_proguard) {
static_library_provider = "//chrome/android:trichrome_library_32_apk"
}
}
}
......@@ -600,9 +618,7 @@ if (android_64bit_target_cpu) {
}
}
# These assets are needed by both monochrome and stand alone WebView, but not by
# Chrome or TrichromeWebView.
android_assets("monochrome_webview_assets") {
android_assets("standalone_webview_assets") {
deps = [
"//third_party/icu:icu_assets",
]
......@@ -616,6 +632,26 @@ android_assets("monochrome_webview_assets") {
}
}
android_assets("monochrome_webview_primary_abi_assets") {
deps = [
"//third_party/icu:icu_assets",
]
if (use_v8_context_snapshot) {
deps += [ "//tools/v8_context_snapshot:v8_context_snapshot_assets" ]
} else {
deps += [ "//v8:v8_external_startup_data_assets" ]
}
}
if (android_64bit_target_cpu) {
android_assets("monochrome_webview_secondary_abi_assets") {
deps = [
"//third_party/icu:icu_assets",
]
deps += [ ":v8_snapshot_secondary_abi_assets" ]
}
}
android_assets("stub_assets") {
renaming_sources = [ "$root_gen_dir/components/resources/about_credits.html" ]
renaming_destinations = [ "webview_licenses.notice" ]
......
......@@ -152,4 +152,14 @@ if (android_64bit_target_cpu) {
"library=libmonochrome_64.so",
]
}
jinja_template("trichrome_webview_32_manifest") {
input = "java/AndroidManifest.xml"
output = trichrome_webview_32_android_manifest
variables = trichrome_jinja_variables + [
"trichrome_version=$trichrome_32_version_code",
"manifest_package=$system_webview_package_name",
"library=libmonochrome.so",
]
}
}
......@@ -56,7 +56,7 @@ template("system_webview_apk_tmpl") {
defined(use_trichrome_library) && use_trichrome_library
if (!_use_trichrome_library) {
deps += [ "//android_webview:monochrome_webview_assets" ]
deps += [ "//android_webview:standalone_webview_assets" ]
}
# Flag whether additional deps and libs should be included for each ABI.
......
......@@ -14,6 +14,8 @@ system_webview_android_manifest =
trichrome_webview_android_manifest =
"$root_gen_dir/android_webview/trichrome_webview_apk/AndroidManifest.xml"
trichrome_webview_64_32_android_manifest = "$root_gen_dir/android_webview/trichrome_webview_64_32_apk/AndroidManifest.xml"
trichrome_webview_32_android_manifest =
"$root_gen_dir/android_webview/trichrome_webview_32_apk/AndroidManifest.xml"
upstream_only_webview_deps = [
"//android_webview:platform_service_bridge_upstream_implementation_java",
......
......@@ -49,6 +49,8 @@ trichrome_library_android_manifest =
"$target_gen_dir/trichrome_library_apk/AndroidManifest.xml"
trichrome_library_64_32_android_manifest =
"$target_gen_dir/trichrome_library_64_32_apk/AndroidManifest.xml"
trichrome_library_32_android_manifest =
"$target_gen_dir/trichrome_library_32_apk/AndroidManifest.xml"
app_hooks_impl = "java/src/org/chromium/chrome/browser/AppHooksImpl.java"
_chrome_version_java_file = "$target_gen_dir/templates/org/chromium/chrome/browser/ChromeVersionConstants.java"
......@@ -100,6 +102,15 @@ if (android_64bit_target_cpu) {
"manifest_package=$trichrome_library_package",
]
}
jinja_template("trichrome_library_32_android_manifest") {
input = "java/AndroidManifest_trichrome_library.xml"
output = trichrome_library_32_android_manifest
variables = trichrome_jinja_variables + [
"trichrome_version=$trichrome_32_version_code",
"manifest_package=$trichrome_library_package",
]
}
}
generate_ui_locale_resources("ui_locale_string_resources") {
......@@ -1858,6 +1869,30 @@ if (public_android_sdk) {
]
}
}
trichrome_library_apk_tmpl("trichrome_library_32_apk") {
apk_name = "TrichromeLibrary32"
android_manifest = trichrome_library_32_android_manifest
android_manifest_dep = ":trichrome_library_32_android_manifest"
is_64_bit_browser = false
include_64_bit_webview = false
if (trichrome_synchronized_proguard) {
shared_resources_whitelist_target =
"//android_webview:system_webview_apk"
shared_resources_whitelist_locales = locales
static_library_dependent_targets = [
{
name = "//android_webview:trichrome_webview_32_apk"
is_resource_ids_provider = true
},
{
name = ":trichrome_chrome_32_bundle"
is_resource_ids_provider = false
},
]
}
}
}
}
......@@ -2521,6 +2556,12 @@ if (public_android_sdk) {
}
if (android_64bit_target_cpu) {
monochrome_or_trichrome_public_bundle_tmpl("monochrome_32_public_bundle") {
bundle_suffix = "32"
is_64_bit_browser = false
include_64_bit_webview = false
}
monochrome_or_trichrome_public_bundle_tmpl("monochrome_64_public_bundle") {
bundle_suffix = "64"
is_64_bit_browser = true
......@@ -2548,6 +2589,13 @@ if (public_android_sdk) {
include_32_bit_webview = true
use_trichrome_library = true
}
monochrome_or_trichrome_public_bundle_tmpl("trichrome_chrome_32_bundle") {
bundle_suffix = "32"
is_64_bit_browser = false
include_64_bit_webview = false
use_trichrome_library = true
}
}
}
......
......@@ -72,7 +72,10 @@ template("chrome_public_common_apk_or_module_tmpl") {
_is_modern = defined(invoker.is_modern) && invoker.is_modern
_is_monochrome = defined(invoker.is_monochrome) && invoker.is_monochrome
_is_trichrome = defined(invoker.is_trichrome) && invoker.is_trichrome
_is_64_bit_browser =
defined(invoker.is_64_bit_browser) && invoker.is_64_bit_browser
assert(_is_modern || !_is_modern) # Mark as used.
assert(_is_64_bit_browser || !_is_64_bit_browser) # Mark as used.
assert(!(_is_monochrome && _is_trichrome),
"Cannot be both trichrome and monochrome!")
......@@ -83,10 +86,10 @@ template("chrome_public_common_apk_or_module_tmpl") {
_add_unwind_tables = invoker.add_unwind_tables_in_apk
} else {
_needs_32bit_lib =
target_cpu == "arm" || (_is_monochrome && target_cpu == "arm64")
target_cpu == "arm" || (target_cpu == "arm64" && !_is_64_bit_browser &&
(_is_monochrome || _is_trichrome))
_add_unwind_tables =
_needs_32bit_lib && _add_unwind_tables_in_chrome_32bit_apk &&
defined(invoker.shared_libraries)
_needs_32bit_lib && _add_unwind_tables_in_chrome_32bit_apk
}
if (_add_unwind_tables) {
......@@ -99,11 +102,21 @@ template("chrome_public_common_apk_or_module_tmpl") {
if (defined(invoker.shared_library_for_unwind_asset)) {
library_target = invoker.shared_library_for_unwind_asset
} else {
library_target = "chrome"
if (_is_monochrome || _is_trichrome) {
library_target = "monochrome"
} else {
library_target = "chrome"
}
}
deps = invoker.shared_libraries
if (defined(android_secondary_abi_cpu)) {
deps += [ "//chrome/android:lib${library_target}($android_secondary_abi_toolchain)" ]
if (android_64bit_target_cpu) {
deps = [
"//chrome/android:lib${library_target}($android_secondary_abi_toolchain)",
]
} else {
deps = [
"//chrome/android:lib${library_target}",
]
}
}
} else if (defined(invoker.shared_library_for_unwind_asset)) {
......@@ -312,6 +325,7 @@ template("monochrome_public_common_apk_or_module_tmpl") {
[
"failed_manifest_expectation_file",
"failed_proguard_expectation_file",
"is_64_bit_browser",
"version_code",
"verify_manifest",
])
......@@ -365,10 +379,7 @@ template("monochrome_public_common_apk_or_module_tmpl") {
_include_primary_support = true
}
shared_library_for_unwind_asset = "monochrome"
_deps += [
"//android_webview:monochrome_webview_assets",
"//android_webview/nonembedded:nonembedded_java",
"//android_webview/glue",
"//chrome/android:monochrome_java",
......@@ -381,18 +392,27 @@ template("monochrome_public_common_apk_or_module_tmpl") {
if (_include_primary_support) {
_deps += [
"//android_webview:monochrome_webview_primary_abi_assets",
"//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline",
]
loadable_modules +=
[ "$root_out_dir/libcrashpad_handler_trampoline.so" ]
}
if (_include_secondary_support) {
_trampoline = "//third_party/crashpad/crashpad/handler:crashpad_handler_trampoline($android_secondary_abi_toolchain)"
_deps += [ _trampoline ]
_trampoline =
"//third_party/crashpad/crashpad/handler:" +
"crashpad_handler_trampoline($android_secondary_abi_toolchain)"
_deps += [
"//android_webview:monochrome_webview_secondary_abi_assets",
_trampoline,
]
_secondary_out_dir = get_label_info(_trampoline, "root_out_dir")
secondary_abi_loadable_modules +=
[ "$_secondary_out_dir/libcrashpad_handler_trampoline.so" ]
}
alternative_android_sdk_dep = webview_framework_dep
app_as_shared_lib = true
_pak_prefix = "monochrome"
......
......@@ -151,8 +151,8 @@ android_apk("weblayer_support_apk") {
deps = [
":weblayer_support_manifest",
"//android_webview:locale_pak_assets",
"//android_webview:monochrome_webview_assets",
"//android_webview:pak_file_assets",
"//android_webview:standalone_webview_assets",
"//base:base_java",
"//weblayer:locale_pak_assets",
"//weblayer/browser/java",
......
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