Skip to content

Commit

Permalink
Reland "Renaming monochrome_public_bundle to m_32_64_p_b for 64-bit b…
Browse files Browse the repository at this point in the history
…uilds"

This is a reland of commit c58c414

Fixed: changed expectations apk lists

Original change's description:
> Renaming monochrome_public_bundle to m_32_64_p_b for 64-bit builds
>
> The goal is to switch the name "monochrome_public_bundle" to build a
> 64-bit primary Chrome. This is the first step, where we make
> "monochrome_public_bundle" an alias to what it used to be. The next
> step will be to change what the alias points to.
>
> This is also true for all other monochrome and trichrome targets that
> default to a 32_64 configuration.
>
> Bug: 1479998
> Change-Id: I0cfa0a84f79dc9013af72c7d653be4187c65ccda
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4858642
> Reviewed-by: Richard (Torne) Coles <torne@chromium.org>
> Commit-Queue: Sam Maier <smaier@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#1202715}

Bug: 1479998
Change-Id: I3bde180558899b8bee0a415fddd2a7e5bd6e043d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4902622
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Commit-Queue: Samuel Huang <huangs@chromium.org>
Auto-Submit: Sam Maier <smaier@chromium.org>
Owners-Override: Sam Maier <smaier@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1202956}
  • Loading branch information
Sam Maier authored and Chromium LUCI CQ committed Sep 28, 2023
1 parent 729da5a commit 4486200
Show file tree
Hide file tree
Showing 10 changed files with 163 additions and 54 deletions.
75 changes: 60 additions & 15 deletions android_webview/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,30 @@ if (enable_resource_allowlist_generation) {
}

if (android_64bit_target_cpu) {
_main_trichrome_library_provider =
"//chrome/android:trichrome_library_32_64_apk"
_main_trichrome_webview_apk_target = "trichrome_webview_32_64_apk"
_main_trichrome_webview_bundle_target = "trichrome_webview_32_64_bundle"
_main_trichrome_webview_base_bundle_module_target =
"trichrome_webview_32_64_base_bundle_module"
_main_system_webview_apk_target = "system_webview_32_64_apk"
_main_system_webview_bundle_target = "system_webview_32_64_bundle"
_main_system_webview_base_bundle_module_target =
"system_webview_32_64_base_bundle_module"

# We are assuming that all webview targets have the same Java - if this
# is no longer true, we should add more targets to this array.
webview_java_for_jni_targets = [ ":system_webview_64_bundle" ]
} else {
_main_trichrome_library_provider = "//chrome/android:trichrome_library_apk"
_main_trichrome_webview_apk_target = "trichrome_webview_apk"
_main_trichrome_webview_bundle_target = "trichrome_webview_bundle"
_main_trichrome_webview_base_bundle_module_target =
"trichrome_webview_base_bundle_module"
_main_system_webview_apk_target = "system_webview_apk"
_main_system_webview_bundle_target = "system_webview_bundle"
_main_system_webview_base_bundle_module_target =
"system_webview_base_bundle_module"
webview_java_for_jni_targets = [ ":system_webview_bundle" ]
}

Expand All @@ -61,7 +81,12 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
deps = [ ":system_webview_64_apk" ]
}
} else {
standalone_system_webview_apk_tmpl("system_webview_apk") {
if (android_64bit_target_cpu) {
group("system_webview_apk") {
deps = [ ":system_webview_32_64_apk" ]
}
}
standalone_system_webview_apk_tmpl(_main_system_webview_apk_target) {
apk_name = "SystemWebView"
}
}
Expand Down Expand Up @@ -92,14 +117,21 @@ standalone_system_webview_apk_tmpl("system_webview_no_weblayer_apk") {
[ "//third_party/androidx:androidx_recyclerview_recyclerview_java" ]
}

_main_webview_bundle_target = ":system_webview_bundle"
if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
_main_webview_bundle_target = ":system_webview_64_bundle"
group("system_webview_bundle") {
deps = [ ":system_webview_64_bundle" ]
}
} else {
standalone_system_webview_apk_tmpl("system_webview_base_bundle_module") {
if (android_64bit_target_cpu) {
group("system_webview_bundle") {
deps = [ ":system_webview_32_64_bundle" ]
}
group("system_webview_base_bundle_module") {
deps = [ ":system_webview_32_64_base_bundle_module" ]
}
}
standalone_system_webview_apk_tmpl(
_main_system_webview_base_bundle_module_target) {
target_type = "android_app_bundle_module"
is_base_module = true

Expand All @@ -109,16 +141,16 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
}
}

system_webview_bundle("system_webview_bundle") {
base_module_target = ":system_webview_base_bundle_module"
system_webview_bundle(_main_system_webview_bundle_target) {
base_module_target = ":$_main_system_webview_base_bundle_module_target"
bundle_name = "SystemWebView"
min_sdk_version = default_min_sdk_version
}

if (is_official_build) {
# Used for binary size monitoring.
create_app_bundle_minimal_apks("system_webview_minimal_apks") {
deps = [ ":system_webview_bundle" ]
deps = [ ":$_main_system_webview_bundle_target" ]
bundle_path = "$root_build_dir/apks/SystemWebView.aab"
}

Expand Down Expand Up @@ -184,13 +216,18 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
deps = [ ":trichrome_webview_64_apk" ]
}
} else {
trichrome_webview_tmpl("trichrome_webview_apk") {
if (android_64bit_target_cpu) {
group("trichrome_webview_apk") {
deps = [ ":trichrome_webview_32_64_apk" ]
}
}
trichrome_webview_tmpl(_main_trichrome_webview_apk_target) {
apk_name = "TrichromeWebView"
if (android_64bit_target_cpu) {
is_64_bit_browser = false
include_64_bit_webview = true
}
static_library_provider = "//chrome/android:trichrome_library_apk"
static_library_provider = _main_trichrome_library_provider
}
}

Expand All @@ -208,7 +245,15 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
deps = [ ":trichrome_webview_64_bundle" ]
}
} else {
trichrome_webview_tmpl("trichrome_webview_base_bundle_module") {
if (android_64bit_target_cpu) {
group("trichrome_webview_bundle") {
deps = [ ":trichrome_webview_32_64_bundle" ]
}
group("trichrome_webview_base_bundle_module") {
deps = [ ":trichrome_webview_32_64_base_bundle_module" ]
}
}
trichrome_webview_tmpl(_main_trichrome_webview_base_bundle_module_target) {
target_type = "android_app_bundle_module"
is_base_module = true
if (android_64bit_target_cpu) {
Expand All @@ -220,14 +265,14 @@ if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
expected_android_manifest =
"expectations/trichrome_webview_bundle.AndroidManifest.expected"
}
static_library_provider = "//chrome/android:trichrome_library_apk"
static_library_provider = _main_trichrome_library_provider
}

system_webview_bundle("trichrome_webview_bundle") {
system_webview_bundle(_main_trichrome_webview_bundle_target) {
is_trichrome = true
base_module_target = ":trichrome_webview_base_bundle_module"
base_module_target = ":$_main_trichrome_webview_base_bundle_module_target"
bundle_name = "TrichromeWebView"
static_library_provider = "//chrome/android:trichrome_library_apk"
static_library_provider = _main_trichrome_library_provider
if (enable_libs_and_assets_verification) {
expected_libs_and_assets =
"expectations/$target_name.$target_cpu.libs_and_assets.expected"
Expand Down Expand Up @@ -259,7 +304,7 @@ if (android_64bit_target_cpu) {
if (is_official_build && !skip_secondary_abi_for_cq) {
# Used for binary size monitoring.
create_app_bundle_minimal_apks("trichrome_webview_minimal_apks") {
deps = [ ":trichrome_webview_bundle" ]
deps = [ ":$_main_trichrome_webview_bundle_target" ]
bundle_path = "$root_build_dir/apks/TrichromeWebView.aab"
}

Expand Down
4 changes: 2 additions & 2 deletions android_webview/tools/system_webview_shell/lint-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
errorLine1=" &lt;activity android:name=&quot;org.chromium.test.broker.OnDeviceInstrumentationBroker&quot; android:exported=&quot;true&quot;/>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="gen/android_webview/tools/system_webview_shell/system_webview_shell_apk__lint/gen/android_webview/system_webview_shell_apk/AndroidManifest.xml"
file="gen/android_webview/tools/system_webview_shell/system_webview_shell_apk__lint/AndroidManifest.xml"
line="185"
column="29"/>
</issue>
Expand Down Expand Up @@ -117,7 +117,7 @@
errorLine1=" &lt;application android:icon=&quot;@drawable/ic_launcher&quot; android:label=&quot;@string/app_name&quot; android:theme=&quot;@style/ShellTheme&quot; android:enableOnBackInvokedCallback=&quot;true&quot; android:networkSecurityConfig=&quot;@xml/network_security_config&quot; android:debuggable=&quot;true&quot;>"
errorLine2=" ~~~~~~~~~~~~~~~~~~~~~~~~~">
<location
file="gen/android_webview/tools/system_webview_shell/system_webview_shell_apk__lint/gen/android_webview/system_webview_shell_apk/AndroidManifest.xml"
file="gen/android_webview/tools/system_webview_shell/system_webview_shell_apk__lint/AndroidManifest.xml"
line="67"
column="224"/>
</issue>
Expand Down
7 changes: 4 additions & 3 deletions build/android/gyp/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,9 +271,10 @@ def _RunLint(create_cache,
extra_manifest_paths,
min_sdk_version,
android_sdk_version)
# Include the rebased manifest_path in the lint generated path so that it is
# clear in error messages where the original AndroidManifest.xml came from.
lint_android_manifest_path = os.path.join(lint_gen_dir, manifest_path)
# Just use a hardcoded name, since we may have different target names (and
# thus different manifest_paths) using the same lint baseline. Eg.
# trichrome_chrome_bundle and trichrome_chrome_32_64_bundle.
lint_android_manifest_path = os.path.join(lint_gen_dir, 'AndroidManifest.xml')
_WriteXmlFile(android_manifest_tree.getroot(), lint_android_manifest_path)

resource_root_dir = os.path.join(lint_gen_dir, _RES_ZIP_DIR)
Expand Down
8 changes: 6 additions & 2 deletions build/config/android/config.gni
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,12 @@ if (is_android || is_chromeos) {
enable_startup_profiles = false

# The target to use as the system WebView implementation.
if (android_64bit_target_cpu && skip_secondary_abi_for_cq) {
system_webview_apk_target = "//android_webview:system_webview_64_apk"
if (android_64bit_target_cpu) {
if (skip_secondary_abi_for_cq) {
system_webview_apk_target = "//android_webview:system_webview_64_apk"
} else {
system_webview_apk_target = "//android_webview:system_webview_32_64_apk"
}
} else {
system_webview_apk_target = "//android_webview:system_webview_apk"
}
Expand Down
6 changes: 5 additions & 1 deletion build/config/android/internal_rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -1077,7 +1077,11 @@ if (enable_java_templates) {
_cache_dir = "$root_build_dir/android_lint_cache"

# Save generated xml files in a consistent location for debugging.
_lint_gen_dir = "$target_gen_dir/$target_name"
if (defined(invoker.lint_gen_dir)) {
_lint_gen_dir = invoker.lint_gen_dir
} else {
_lint_gen_dir = "$target_gen_dir/$target_name"
}
_backported_methods = "//third_party/r8/backported_methods.txt"

script = "//build/android/gyp/lint.py"
Expand Down
5 changes: 5 additions & 0 deletions build/config/android/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -3123,6 +3123,7 @@ if (enable_java_templates && is_android) {
forward_variables_from(invoker,
[
"lint_baseline_file",
"lint_gen_dir",
"lint_suppressions_file",
"min_sdk_version",
])
Expand All @@ -3142,6 +3143,7 @@ if (enable_java_templates && is_android) {
not_needed(invoker,
[
"lint_baseline_file",
"lint_gen_dir",
"lint_jar_path",
"lint_min_sdk_version",
"lint_suppressions_dep",
Expand Down Expand Up @@ -3260,6 +3262,7 @@ if (enable_java_templates && is_android) {
"keystore_password",
"keystore_path",
"lint_baseline_file",
"lint_gen_dir",
"lint_min_sdk_version",
"lint_suppressions_dep",
"lint_suppressions_file",
Expand Down Expand Up @@ -5141,6 +5144,7 @@ if (enable_java_templates && is_android) {
forward_variables_from(invoker,
[
"lint_baseline_file",
"lint_gen_dir",
"lint_jar_path",
"lint_suppressions_file",
])
Expand All @@ -5160,6 +5164,7 @@ if (enable_java_templates && is_android) {
not_needed(invoker,
[
"lint_baseline_file",
"lint_gen_dir",
"lint_jar_path",
"lint_min_sdk_version",
"lint_suppressions_dep",
Expand Down
Loading

0 comments on commit 4486200

Please sign in to comment.