Commit 597c6ab3 authored by oysteine's avatar oysteine Committed by Commit Bot

Revert "Introduce bundle-specific native libraries"

This reverts commit 50ab16b8.

Reason for revert: crbug.com/905853

Original change's description:
> Introduce bundle-specific native libraries
> 
> This will allow native code to be stripped out of the main library
> when it moves to a Dynamic Feature Module.  For now, the libraries will
> be identical.
> 
> BUG=874584
> 
> Change-Id: I8a54e6402a3686939dd14b509c614da99b0ff913
> Reviewed-on: https://chromium-review.googlesource.com/c/1332248
> Reviewed-by: Yaron Friedman <yfriedman@chromium.org>
> Reviewed-by: David Turner <digit@chromium.org>
> Reviewed-by: Tibor Goldschwendt <tiborg@chromium.org>
> Commit-Queue: Christopher Grant <cjgrant@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#608519}

TBR=digit@chromium.org,yfriedman@chromium.org,cjgrant@chromium.org,tiborg@chromium.org

Change-Id: I0780066bf999c3c25cc7c8c840abad97105a6762
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 874584
Reviewed-on: https://chromium-review.googlesource.com/c/1337484Reviewed-by: default avataroysteine <oysteine@chromium.org>
Commit-Queue: oysteine <oysteine@chromium.org>
Cr-Commit-Position: refs/heads/master@{#608564}
parent c534927e
...@@ -1056,27 +1056,14 @@ template("chrome_shared_library") { ...@@ -1056,27 +1056,14 @@ template("chrome_shared_library") {
} }
} }
# This template creates a native library for Chrome's APK or bundle. chrome_shared_library("libchrome") {
template("libchrome_apk_or_bundle_tmpl") { sources = [
chrome_shared_library(target_name) { "../browser/android/chrome_entry_point.cc",
forward_variables_from(invoker, "*") chrome_jni_registration_header,
sources = [ ]
"../browser/android/chrome_entry_point.cc", deps = [
chrome_jni_registration_header, ":chrome_jni_registration($default_toolchain)",
] ]
deps = [
":chrome_jni_registration($default_toolchain)",
]
}
}
# Chrome APK's native library.
libchrome_apk_or_bundle_tmpl("libchrome") {
}
# Chrome bundle's base module native library. This is currently the same as the
# APK version, but will diverge when code moves into feature modules.
libchrome_apk_or_bundle_tmpl("libchrome_base") {
} }
chrome_shared_library("libchromefortest") { chrome_shared_library("libchromefortest") {
...@@ -1126,20 +1113,22 @@ if (current_toolchain == default_toolchain) { ...@@ -1126,20 +1113,22 @@ if (current_toolchain == default_toolchain) {
# is_monochrome: If true, generate Monochrome targets rather than Chrome. # is_monochrome: If true, generate Monochrome targets rather than Chrome.
# is_bundle: If true, generate resources for bundles rather than APK. # is_bundle: If true, generate resources for bundles rather than APK.
template("resource_packaging") { template("resource_packaging") {
not_needed([ "target_name" ])
_is_monochrome = invoker.is_monochrome _is_monochrome = invoker.is_monochrome
_is_bundle = invoker.is_bundle _is_bundle = invoker.is_bundle
if (_is_monochrome) { if (_is_monochrome) {
_type = "monochrome" _prefix = "monochrome"
} else { } else {
_type = "chrome" _prefix = "chrome"
} }
if (_is_bundle) { if (_is_bundle) {
_output_type = "bundle" _output_type = "bundle"
} else { } else {
_output_type = "apk" _output_type = "apk"
} }
_variant = "${_type}_${_output_type}" _variant = "${_prefix}_${_output_type}"
if (enable_resource_whitelist_generation) { if (enable_resource_whitelist_generation) {
_resource_whitelist_target = "${_variant}_resource_whitelist" _resource_whitelist_target = "${_variant}_resource_whitelist"
...@@ -1147,17 +1136,10 @@ if (current_toolchain == default_toolchain) { ...@@ -1147,17 +1136,10 @@ if (current_toolchain == default_toolchain) {
"$target_gen_dir/${_variant}_resource_whitelist.txt" "$target_gen_dir/${_variant}_resource_whitelist.txt"
if (_is_monochrome) { if (_is_monochrome) {
_target_prefix = "" _target = "monochrome"
} else { } else {
_target_prefix = "lib" _target = "libchrome"
} }
if (_is_bundle) {
_suffix = "_base"
} else {
_suffix = ""
}
_lib_path = "/lib.unstripped/lib" + _type + _suffix + shlib_extension
_lib_target = _target_prefix + _type + _suffix
generate_resource_whitelist(_resource_whitelist_target) { generate_resource_whitelist(_resource_whitelist_target) {
_fat_lib_toolchain = "" _fat_lib_toolchain = ""
...@@ -1171,10 +1153,11 @@ if (current_toolchain == default_toolchain) { ...@@ -1171,10 +1153,11 @@ if (current_toolchain == default_toolchain) {
} }
} }
deps = [ deps = [
":${_lib_target}($_fat_lib_toolchain)", ":${_target}($_fat_lib_toolchain)",
] ]
input = get_label_info(deps[0], "root_out_dir") + _lib_path input = get_label_info(deps[0], "root_out_dir") +
"/lib.unstripped/lib${_prefix}$shlib_extension"
output = _resource_whitelist_file output = _resource_whitelist_file
} }
...@@ -1186,9 +1169,10 @@ if (current_toolchain == default_toolchain) { ...@@ -1186,9 +1169,10 @@ if (current_toolchain == default_toolchain) {
_locale_whitelist_target = "${_variant}_locale_whitelist" _locale_whitelist_target = "${_variant}_locale_whitelist"
_locale_whitelist_file = _locale_whitelist_file =
"$target_gen_dir/${_variant}_locale_whitelist.txt" "$target_gen_dir/${_variant}_locale_whitelist.txt"
_system_webview_locale_resource_id_list = "$target_gen_dir/${_variant}_system_webview_locale_resource_id_list.txt" _system_webview_locale_resource_id_list =
"$target_gen_dir/system_webview_locale_resource_id_list.txt"
action("${_variant}_system_webview_locale_resource_id_list") { action("system_webview_locale_resource_id_list") {
script = "//tools/grit/pak_util.py" script = "//tools/grit/pak_util.py"
_system_webview_en_US_locale_pak = _system_webview_en_US_locale_pak =
...@@ -1229,7 +1213,7 @@ if (current_toolchain == default_toolchain) { ...@@ -1229,7 +1213,7 @@ if (current_toolchain == default_toolchain) {
deps = [ deps = [
":${_resource_whitelist_target}", ":${_resource_whitelist_target}",
":${_variant}_system_webview_locale_resource_id_list", ":system_webview_locale_resource_id_list",
"//android_webview:system_webview_pak_whitelist", "//android_webview:system_webview_pak_whitelist",
] ]
...@@ -1247,7 +1231,7 @@ if (current_toolchain == default_toolchain) { ...@@ -1247,7 +1231,7 @@ if (current_toolchain == default_toolchain) {
} }
chrome_paks("${_variant}_paks") { chrome_paks("${_variant}_paks") {
output_dir = "$target_gen_dir/${_variant}_paks" output_dir = "$target_gen_dir/$target_name"
deps = [] deps = []
if (_is_monochrome) { if (_is_monochrome) {
...@@ -1284,8 +1268,7 @@ if (current_toolchain == default_toolchain) { ...@@ -1284,8 +1268,7 @@ if (current_toolchain == default_toolchain) {
} }
# This target explicitly includes locale paks via deps. # This target explicitly includes locale paks via deps.
android_assets(target_name) { android_assets("${_variant}_pak_assets") {
assert("${_variant}_pak_assets" == target_name)
sources = [ sources = [
"$target_gen_dir/${_variant}_paks/chrome_100_percent.pak", "$target_gen_dir/${_variant}_paks/chrome_100_percent.pak",
"$target_gen_dir/${_variant}_paks/resources.pak", "$target_gen_dir/${_variant}_paks/resources.pak",
...@@ -1302,24 +1285,14 @@ if (current_toolchain == default_toolchain) { ...@@ -1302,24 +1285,14 @@ if (current_toolchain == default_toolchain) {
} }
} }
# Resource packaging varies with Monochrome and bundles because the pak resource_packaging("") {
# resource whitelist is derived from the native library.
resource_packaging("chrome_apk_pak_assets") {
is_monochrome = false is_monochrome = false
is_bundle = false is_bundle = false
} }
resource_packaging("monochrome_apk_pak_assets") { resource_packaging("") {
is_monochrome = true is_monochrome = true
is_bundle = false is_bundle = false
} }
resource_packaging("chrome_bundle_pak_assets") {
is_monochrome = false
is_bundle = true
}
resource_packaging("monochrome_bundle_pak_assets") {
is_monochrome = true
is_bundle = true
}
# TODO(cjgrant): Remove this temporary alias after downstream renaming lands. # TODO(cjgrant): Remove this temporary alias after downstream renaming lands.
java_group("chrome_public_pak_assets") { java_group("chrome_public_pak_assets") {
...@@ -1337,29 +1310,17 @@ if (current_toolchain == default_toolchain) { ...@@ -1337,29 +1310,17 @@ if (current_toolchain == default_toolchain) {
# for 64-bit APK. # for 64-bit APK.
if (!android_64bit_target_cpu || if (!android_64bit_target_cpu ||
current_toolchain == android_secondary_abi_toolchain) { current_toolchain == android_secondary_abi_toolchain) {
# Monochrome equivalent of Chrome's APK or bundle library template. chrome_common_shared_library("monochrome") {
template("libmonochrome_apk_or_bundle_tmpl") { sources = [
chrome_common_shared_library(target_name) { "../browser/android/monochrome_entry_point.cc",
forward_variables_from(invoker, "*") ]
sources = [ deps = [
"../browser/android/monochrome_entry_point.cc", "//android_webview:common",
] ]
deps = [
"//android_webview:common",
]
export_java_symbols = true
enable_compressed_relocations = use_lld
use_gnu_hash_style = true
}
}
# Monochrome APK native library.
libmonochrome_apk_or_bundle_tmpl("monochrome") {
}
# Monochrome bundle native library. export_java_symbols = true
libmonochrome_apk_or_bundle_tmpl("monochrome_base") { enable_compressed_relocations = use_lld
use_gnu_hash_style = true
} }
} else { } else {
group("monochrome_secondary_abi_lib") { group("monochrome_secondary_abi_lib") {
...@@ -1399,6 +1360,7 @@ _chrome_public_shared_deps = [ ...@@ -1399,6 +1360,7 @@ _chrome_public_shared_deps = [
":chrome_public_apk_resources", ":chrome_public_apk_resources",
":chrome_public_base_module_java", ":chrome_public_base_module_java",
":chrome_public_non_pak_assets", ":chrome_public_non_pak_assets",
":chrome_apk_pak_assets",
] ]
generate_jni("test_support_jni_headers") { generate_jni("test_support_jni_headers") {
...@@ -1481,18 +1443,10 @@ template("chrome_public_apk_or_module_tmpl") { ...@@ -1481,18 +1443,10 @@ template("chrome_public_apk_or_module_tmpl") {
android_manifest_dep = ":chrome_public_android_manifest" android_manifest_dep = ":chrome_public_android_manifest"
} }
if (invoker.target_type == "android_app_bundle_module") { shared_libraries = [ ":libchrome" ]
deps += [ ":chrome_bundle_pak_assets" ]
_suffix = "_base"
} else {
deps += [ ":chrome_apk_pak_assets" ]
_suffix = ""
}
shared_libraries = [ ":libchrome${_suffix}" ]
add_unwind_tables_in_apk = _add_unwind_tables_in_chrome_public_apk add_unwind_tables_in_apk = _add_unwind_tables_in_chrome_public_apk
if (_add_unwind_tables_in_chrome_public_apk) { if (_add_unwind_tables_in_chrome_public_apk) {
shared_library_for_unwind_asset = "chrome${_suffix}" shared_library_for_unwind_asset = "chrome"
} }
# Android supports webp transparent resources properly since API level 18, # Android supports webp transparent resources properly since API level 18,
...@@ -1604,11 +1558,7 @@ template("monochrome_public_apk_or_module_tmpl") { ...@@ -1604,11 +1558,7 @@ template("monochrome_public_apk_or_module_tmpl") {
_add_unwind_tables_in_chrome_public_apk && _add_unwind_tables_in_chrome_public_apk &&
(!defined(use_trichrome_library) || !use_trichrome_library) (!defined(use_trichrome_library) || !use_trichrome_library)
if (add_unwind_tables_in_apk && can_unwind_with_cfi_table) { if (add_unwind_tables_in_apk && can_unwind_with_cfi_table) {
if (invoker.target_type == "android_app_bundle_module") { shared_library_for_unwind_asset = "monochrome"
shared_library_for_unwind_asset = "monochrome_base"
} else {
shared_library_for_unwind_asset = "monochrome"
}
} }
version_name = chrome_version_name version_name = chrome_version_name
...@@ -1752,7 +1702,6 @@ template("chrome_test_apk_tmpl") { ...@@ -1752,7 +1702,6 @@ template("chrome_test_apk_tmpl") {
} }
deps = _chrome_public_shared_deps + invoker.deps + [ deps = _chrome_public_shared_deps + invoker.deps + [
":chrome_apk_pak_assets",
":chrome_public_base_module_java_for_test", ":chrome_public_base_module_java_for_test",
"//third_party/android_support_test_runner:runner_java", "//third_party/android_support_test_runner:runner_java",
"//third_party/android_tools:android_test_base_java", "//third_party/android_tools:android_test_base_java",
......
...@@ -209,11 +209,7 @@ template("monochrome_public_common_apk_or_module_tmpl") { ...@@ -209,11 +209,7 @@ template("monochrome_public_common_apk_or_module_tmpl") {
if (android_64bit_target_cpu) { if (android_64bit_target_cpu) {
shared_libraries = [ "//android_webview:monochrome" ] shared_libraries = [ "//android_webview:monochrome" ]
} else { } else {
if (invoker.target_type == "android_app_bundle_module") { shared_libraries = [ "//chrome/android:monochrome" ]
shared_libraries = [ "//chrome/android:monochrome_base" ]
} else {
shared_libraries = [ "//chrome/android:monochrome" ]
}
} }
if (android_64bit_target_cpu && build_apk_secondary_abi) { if (android_64bit_target_cpu && build_apk_secondary_abi) {
secondary_abi_shared_libraries = secondary_abi_shared_libraries =
...@@ -269,13 +265,9 @@ template("monochrome_public_common_apk_or_module_tmpl") { ...@@ -269,13 +265,9 @@ template("monochrome_public_common_apk_or_module_tmpl") {
"//android_webview/apk:webview_license_activity_java", "//android_webview/apk:webview_license_activity_java",
"//android_webview/glue", "//android_webview/glue",
"//chrome/android:chrome_public_non_pak_assets", "//chrome/android:chrome_public_non_pak_assets",
"//chrome/android:monochrome_apk_pak_assets",
"//chrome/android/monochrome:monochrome_license_provider_java", "//chrome/android/monochrome:monochrome_license_provider_java",
] ]
if (invoker.target_type == "android_app_bundle_module") {
deps += [ "//chrome/android:monochrome_bundle_pak_assets" ]
} else {
deps += [ "//chrome/android:monochrome_apk_pak_assets" ]
}
if (_enable_multidex && invoker.target_type == "android_apk" && if (_enable_multidex && invoker.target_type == "android_apk" &&
!defined(invoker.negative_main_dex_globs)) { !defined(invoker.negative_main_dex_globs)) {
......
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