0

Remove version from bundletool filepath references (Reland)

The bundletool jar path containing version is listed in a few places in
the build system. Remove the version from the jar path (autoroller
cannot update all these places with the new version number). Also adds
the bundletool jar path as a input to a few actions to avoid stale
builds from cls just updating bundletool.

Change-Id: I8d497bb882008ad4e34a5a0aa795ee4df5625e3f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3200346
Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
Auto-Submit: Mohamed Heikal <mheikal@chromium.org>
Reviewed-by: Andrew Grieve <agrieve@chromium.org>
Cr-Commit-Position: refs/heads/main@{#927801}
This commit is contained in:
Mohamed Heikal
2021-10-04 20:05:10 +00:00
committed by Chromium LUCI CQ
parent a39f454cbe
commit f9d9edb492
7 changed files with 22 additions and 23 deletions

2
DEPS

@ -846,7 +846,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/bundletool',
'version': 'nK0LSzIJHh_OqyIEMh3zye_Ad54jw57inqQF5jFJzdYC',
'version': 'OZ4is33usuZy-deP3FpWCtbKXaIY0qBLsElWte7556YC',
},
],
'condition': 'checkout_android',

@ -68,9 +68,7 @@ group("apk_installer_data") {
"//build/android/pylib/device/commands",
"//tools/android/md5sum",
]
data = [
"//third_party/android_build_tools/bundletool/bundletool-all-1.8.0.jar",
]
data = [ "//third_party/android_build_tools/bundletool/bundletool.jar" ]
}
}

@ -111,7 +111,7 @@
"file_info": {
"default": {
"local_paths": [
"../../third_party/android_build_tools/bundletool/bundletool-all-1.8.0.jar"
"../../third_party/android_build_tools/bundletool/bundletool.jar"
]
}
}

@ -19,10 +19,7 @@ BUNDLETOOL_DIR = os.path.abspath(os.path.join(
__file__, '..', '..', '..', '..', 'third_party', 'android_build_tools',
'bundletool'))
BUNDLETOOL_VERSION = '1.8.0'
BUNDLETOOL_JAR_PATH = os.path.join(
BUNDLETOOL_DIR, 'bundletool-all-%s.jar' % BUNDLETOOL_VERSION)
BUNDLETOOL_JAR_PATH = os.path.join(BUNDLETOOL_DIR, 'bundletool.jar')
def RunBundleTool(args, warnings_as_errors=(), print_stdout=False):

@ -140,18 +140,15 @@ def GenerateBundleApks(bundle_path,
build_utils.DoZip(files, f, base_dir=temp_dir)
if check_for_noop:
# NOTE: BUNDLETOOL_JAR_PATH is added to input_strings, rather than
# input_paths, to speed up MD5 computations by about 400ms (the .jar file
# contains thousands of class files which are checked independently,
# resulting in an .md5.stamp of more than 60000 lines!).
input_paths = [bundle_path, aapt2_path, keystore_path]
input_paths = [
bundle_path,
bundletool.BUNDLETOOL_JAR_PATH,
aapt2_path,
keystore_path,
]
input_strings = [
keystore_password,
keystore_alias,
bundletool.BUNDLETOOL_JAR_PATH,
# NOTE: BUNDLETOOL_VERSION is already part of BUNDLETOOL_JAR_PATH, but
# it's simpler to assume that this may not be the case in the future.
bundletool.BUNDLETOOL_VERSION,
device_spec,
]
if mode is not None:

@ -35,6 +35,9 @@ if (use_cfi_diag || is_ubsan || is_ubsan_security || is_ubsan_vptr) {
_sanitizer_runtimes = [ "$clang_base_path/lib/clang/$clang_version/lib/linux/libclang_rt.ubsan_standalone-$_sanitizer_arch-android.so" ]
}
_BUNDLETOOL_JAR_PATH =
"//third_party/android_build_tools/bundletool/bundletool.jar"
# Creates a dist directory for a native executable.
#
# Running a native executable on a device requires all the shared library
@ -4852,7 +4855,8 @@ if (enable_java_templates) {
_bundle_target_name = "${_target_name}__bundle"
action_with_pydeps(_bundle_target_name) {
script = "//build/android/gyp/create_app_bundle.py"
inputs = _all_module_zip_paths + _all_module_build_configs
inputs = _all_module_zip_paths + _all_module_build_configs +
[ _BUNDLETOOL_JAR_PATH ]
outputs = [ _bundle_path ]
deps = _all_create_module_targets + [ ":$_build_config_target" ]
args = [
@ -5073,7 +5077,10 @@ if (enable_java_templates) {
_apks_path = "$root_build_dir/apks/$_bundle_name.apks"
action_with_pydeps("${_target_name}_apks") {
script = "//build/android/gyp/create_app_bundle_apks.py"
inputs = [ _bundle_path ]
inputs = [
_bundle_path,
_BUNDLETOOL_JAR_PATH,
]
outputs = [ _apks_path ]
data = [ _apks_path ]
args = [

@ -247,8 +247,8 @@ $ adb shell dumpsys package org.chromium.chrome | grep splits
*** note
The wrapper script's `install` command does approximately:
```sh
java -jar third_party/android_build_tools/bundletool/bundletool-all-$VERSION.jar build-apks --output tmp.apks ...
java -jar third_party/android_build_tools/bundletool/bundletool-all-$VERSION.jar install-apks --apks tmp.apks
java -jar third_party/android_build_tools/bundletool/bundletool.jar build-apks --output tmp.apks ...
java -jar third_party/android_build_tools/bundletool/bundletool.jar install-apks --apks tmp.apks
```
The `install-apks` command uses `adb install-multiple` under-the-hood.
@ -993,4 +993,4 @@ template("chrome_public_common_apk_or_module_tmpl") {
You may also have to add `java` as a dependency of `chrome_test_java` if you want
to call into Foo from test code.
[play-core-local-testing]: https://developer.android.com/guide/playcore/feature-delivery/on-demand#local-testing
[play-core-local-testing]: https://developer.android.com/guide/playcore/feature-delivery/on-demand#local-testing