Skip to content

Commit

Permalink
Revert "Remove version from bundletool filepath references in build"
Browse files Browse the repository at this point in the history
This reverts commit 0dd7b07.

Reason for revert: Broke compile (Reference in app_bundle_utils.py)

Original change's description:
> Remove version from bundletool filepath references in build
>
> The bundletool jar path containing the 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: I41cbe7d45e9f31b64b7f3148687004aa2dbe48e7
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3166930
> Commit-Queue: Mohamed Heikal <mheikal@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Cr-Commit-Position: refs/heads/main@{#927311}

Change-Id: I0e95fd40165b3b695d66f9a8b846a0ef5b0c2b6a
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3198541
Bot-Commit: Rubber Stamper <rubber-stamper@appspot.gserviceaccount.com>
Owners-Override: Peter Kotwicz <pkotwicz@google.com>
Commit-Queue: Peter Kotwicz <pkotwicz@chromium.org>
Cr-Commit-Position: refs/heads/main@{#927461}
  • Loading branch information
pkotwicz authored and Chromium LUCI CQ committed Oct 2, 2021
1 parent 5f7f67e commit 388a02c
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion DEPS
Original file line number Diff line number Diff line change
Expand Up @@ -846,7 +846,7 @@ deps = {
'packages': [
{
'package': 'chromium/third_party/android_build_tools/bundletool',
'version': 'OZ4is33usuZy-deP3FpWCtbKXaIY0qBLsElWte7556YC',
'version': 'nK0LSzIJHh_OqyIEMh3zye_Ad54jw57inqQF5jFJzdYC',
},
],
'condition': 'checkout_android',
Expand Down
4 changes: 3 additions & 1 deletion build/android/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,9 @@ group("apk_installer_data") {
"//build/android/pylib/device/commands",
"//tools/android/md5sum",
]
data = [ "//third_party/android_build_tools/bundletool/bundletool.jar" ]
data = [
"//third_party/android_build_tools/bundletool/bundletool-all-1.8.0.jar",
]
}
}

Expand Down
2 changes: 1 addition & 1 deletion build/android/devil_chromium.json
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"file_info": {
"default": {
"local_paths": [
"../../third_party/android_build_tools/bundletool/bundletool.jar"
"../../third_party/android_build_tools/bundletool/bundletool-all-1.8.0.jar"
]
}
}
Expand Down
5 changes: 4 additions & 1 deletion build/android/gyp/bundletool.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@
__file__, '..', '..', '..', '..', 'third_party', 'android_build_tools',
'bundletool'))

BUNDLETOOL_JAR_PATH = os.path.join(BUNDLETOOL_DIR, 'bundletool.jar')
BUNDLETOOL_VERSION = '1.8.0'

BUNDLETOOL_JAR_PATH = os.path.join(
BUNDLETOOL_DIR, 'bundletool-all-%s.jar' % BUNDLETOOL_VERSION)


def RunBundleTool(args, warnings_as_errors=(), print_stdout=False):
Expand Down
11 changes: 2 additions & 9 deletions build/config/android/rules.gni
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,6 @@ 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
Expand Down Expand Up @@ -4855,8 +4852,7 @@ 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 +
[ _BUNDLETOOL_JAR_PATH ]
inputs = _all_module_zip_paths + _all_module_build_configs
outputs = [ _bundle_path ]
deps = _all_create_module_targets + [ ":$_build_config_target" ]
args = [
Expand Down Expand Up @@ -5077,10 +5073,7 @@ 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,
_BUNDLETOOL_JAR_PATH,
]
inputs = [ _bundle_path ]
outputs = [ _apks_path ]
data = [ _apks_path ]
args = [
Expand Down
6 changes: 3 additions & 3 deletions docs/android_dynamic_feature_modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.jar build-apks --output tmp.apks ...
java -jar third_party/android_build_tools/bundletool/bundletool.jar install-apks --apks tmp.apks
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
```

The `install-apks` command uses `adb install-multiple` under-the-hood.
Expand Down Expand Up @@ -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

0 comments on commit 388a02c

Please sign in to comment.