Commit 4ede9b9f authored by Eric Stevenson's avatar Eric Stevenson Committed by Commit Bot

Android: Clean up trichrome synchronized proguard build rules.

  * Remove static_library_proguard_disabled and instead separate
    static_library_provider and static_library_synchronized_proguard
    into separate flags.
  * Only enable synchronized proguard for the most basic Trichrome
    targets (can enable for others when we want to ship).
  * Add a real dep on static library provider APKs (so that they don't
    both need to be compiled explicitly).
  * Clean up stale GN variables.

Bug: 921284, 901465
Change-Id: I346fe3e824ece041cd1df064e81b2939e64c6882
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1955802
Commit-Queue: Eric Stevenson <estevenson@chromium.org>
Reviewed-by: default avatarRichard Coles <torne@chromium.org>
Reviewed-by: default avatarAndrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726483}
parent e071805c
......@@ -58,8 +58,9 @@ if (public_android_sdk) {
}
uncompress_dex = true
if (trichrome_synchronized_proguard) {
static_library_provider = "//chrome/android:trichrome_library_apk"
static_library_provider = "//chrome/android:trichrome_library_apk"
if (!is_java_debug) {
static_library_synchronized_proguard = trichrome_synchronized_proguard
}
}
......@@ -78,9 +79,7 @@ if (public_android_sdk) {
deps = upstream_only_webview_deps
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"
}
}
}
......
This diff is collapsed.
......@@ -1757,6 +1757,8 @@ template("monochrome_public_apk_or_module_tmpl") {
[
"apk_name",
"bundle_target",
"failed_manifest_expectation_file",
"failed_proguard_expectation_file",
"include_32_bit_webview",
"include_64_bit_webview",
"is_64_bit_browser",
......@@ -1764,13 +1766,12 @@ template("monochrome_public_apk_or_module_tmpl") {
"proguard_jar_path",
"resource_ids_provider_dep",
"static_library_provider",
"static_library_synchronized_proguard",
"target_type",
"use_chromium_linker",
"use_modern_linker",
"use_trichrome_library",
"verify_manifest",
"failed_manifest_expectation_file",
"failed_proguard_expectation_file",
"version_code",
"version_name",
])
......@@ -1810,7 +1811,6 @@ if (public_android_sdk) {
version_name = chrome_version_name
apk_name = "MonochromePublic"
target_type = "android_apk"
if (android_64bit_target_cpu) {
is_64_bit_browser = false
include_64_bit_webview = true
......@@ -1828,18 +1828,8 @@ if (public_android_sdk) {
}
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_apk"
is_resource_ids_provider = true
},
{
name = ":trichrome_chrome_bundle"
is_resource_ids_provider = false
},
]
webview_target = "//android_webview:trichrome_webview_apk"
chrome_target = ":trichrome_chrome_bundle"
}
}
......@@ -1852,19 +1842,8 @@ if (public_android_sdk) {
include_32_bit_webview = true
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_64_32_apk"
is_resource_ids_provider = true
},
{
name = ":trichrome_chrome_64_32_bundle"
is_resource_ids_provider = false
},
]
webview_target = "//android_webview:trichrome_webview_64_32_apk"
chrome_target = ":trichrome_chrome_64_32_bundle"
}
}
......@@ -2435,9 +2414,13 @@ template("monochrome_or_trichrome_public_bundle_tmpl") {
"is_64_bit_browser",
"include_32_bit_webview",
"include_64_bit_webview",
"static_library_provider",
"static_library_synchronized_proguard",
"use_trichrome_library",
])
bundle_target = ":${invoker.target_name}"
if (!_is_trichrome || !trichrome_synchronized_proguard) {
bundle_target = ":${invoker.target_name}"
}
target_type = "android_app_bundle_module"
is_base_module = true
version_code = _version_code
......@@ -2460,8 +2443,8 @@ template("monochrome_or_trichrome_public_bundle_tmpl") {
"include_32_bit_webview",
"include_64_bit_webview",
"is_64_bit_browser",
"static_library_proguard_disabled",
"static_library_provider",
"static_library_synchronized_proguard",
])
base_module_target = ":$_base_module_target_name"
bundle_name = _bundle_name
......@@ -2480,10 +2463,6 @@ template("monochrome_or_trichrome_public_bundle_tmpl") {
"monochrome_public_bundle.proguard_flags.failed"
}
}
if (trichrome_synchronized_proguard && _is_trichrome) {
static_library_provider = ":trichrome_library_apk"
}
}
}
......@@ -2529,7 +2508,7 @@ if (public_android_sdk) {
use_trichrome_library = true
static_library_provider = ":trichrome_library_apk"
if (!is_java_debug) {
static_library_proguard_disabled = !trichrome_synchronized_proguard
static_library_synchronized_proguard = trichrome_synchronized_proguard
}
if (android_64bit_target_cpu) {
is_64_bit_browser = false
......@@ -2556,6 +2535,7 @@ if (public_android_sdk) {
is_64_bit_browser = true
include_32_bit_webview = false
use_trichrome_library = true
static_library_provider = ":trichrome_library_64_apk"
}
monochrome_or_trichrome_public_bundle_tmpl(
......@@ -2564,6 +2544,7 @@ if (public_android_sdk) {
is_64_bit_browser = true
include_32_bit_webview = true
use_trichrome_library = true
static_library_provider = ":trichrome_library_64_32_apk"
}
}
}
......
......@@ -17,7 +17,7 @@
-keep,allowobfuscation class android.support.v7.app.MediaRouteControllerDialog$MediaControllerCallback { *; }
-keep,allowobfuscation class android.support.v7.media.MediaRouter$GlobalMediaRouter { *; }
-keep,allowobfuscation class android.support.v7.media.MediaRouter$GlobalMediaRouter$** { *; }
-keep,allowobfuscation class com.google.protobuf.nano.CodedOutputByteBufferNano { *; }
-keep,allowobfuscation class com.google.common.logging.nano.Vr$VREvent$HistogramBucket { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.ChromeActivity { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.ChromeFeatureList { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.compositor.CompositorViewHolder { *; }
......@@ -25,6 +25,7 @@
-keep,allowobfuscation class org.chromium.chrome.browser.compositor.layouts.components.VirtualView { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.compositor.layouts.LayoutManager { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.contacts_picker.ContactsPickerDialog { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.contextmenu.ChromeContextMenuItem { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.crash.LogcatExtractionRunnable { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.favicon.LargeIconBridge { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.favicon.LargeIconBridge$LargeIconCallback { *; }
......@@ -52,7 +53,22 @@
-keep,allowobfuscation class org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataTabsFragment { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.preferences.privacy.ClearBrowsingDataTabsFragment$ClearBrowsingDataPagerAdapter { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.profiles.Profile { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.languages.AddLanguageFragment { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.languages.AddLanguageFragment$$Lambda$1 { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.languages.AddLanguageFragment$LanguageSearchListAdapter { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.languages.LanguageListBaseAdapter { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.privacy.ClearBrowsingDataFetcher { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.privacy.ClearBrowsingDataPreferences { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.privacy.ClearBrowsingDataPreferencesAdvanced { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.privacy.ClearBrowsingDataPreferencesBasic { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.privacy.ClearBrowsingDataTabsFragment { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.settings.privacy.ClearBrowsingDataTabsFragment$ClearBrowsingDataPagerAdapter { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.tab.Tab { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.ui.appmenu.AppMenuCoordinator { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.ui.appmenu.AppMenuCoordinatorImpl { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.ui.appmenu.AppMenuHandler { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.ui.appmenu.AppMenuHandlerImpl { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.ui.RootUiCoordinator { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.usage_stats.NotificationSuspender$** { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.usage_stats.SuspensionTracker { *; }
-keep,allowobfuscation class org.chromium.chrome.browser.usage_stats.UsageStatsService { *; }
......
......@@ -78,6 +78,7 @@ template("chrome_bundle") {
"sign_bundle",
"static_library_proguard_disabled",
"static_library_provider",
"static_library_synchronized_proguard",
"verify_proguard_flags",
])
command_line_flags_file = "chrome-command-line"
......
......@@ -48,9 +48,6 @@ template("trichrome_library_apk_tmpl") {
"apk_name",
"min_sdk_version",
"proguard_jar_path",
"shared_resources_whitelist_target",
"shared_resources_whitelist_locales",
"static_library_dependent_targets",
"target_sdk_version",
])
......@@ -64,6 +61,19 @@ template("trichrome_library_apk_tmpl") {
# TODO(crbug.com/956839): Remove this once R8 fixes the class merging
# and/or inlining bugs.
disable_r8_outlining = true
if (defined(invoker.webview_target) && defined(invoker.chrome_target)) {
shared_resources_whitelist_locales = locales
static_library_dependent_targets = [
{
name = invoker.webview_target
is_resource_ids_provider = true
},
{
name = invoker.chrome_target
is_resource_ids_provider = false
},
]
}
} else {
# TODO(crbug.com/901465): Remove r_java_root_package_name once shared
# Java code is moved to the shared library even in debug.
......@@ -100,11 +110,12 @@ template("trichrome_library_apk_tmpl") {
min_sdk_version = 29
target_sdk_version = android_sdk_version
if (!enable_trichrome_synchronized_proguard) {
generate_buildconfig_java = false
} else {
if (trichrome_synchronized_proguard) {
product_version_resources_dep =
"//chrome/android:product_version_resources"
} else {
generate_buildconfig_java = false
}
# TODO(torne): using icon_resources just to get a temporary icon
......
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