aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadaf Ebrahimi <sadafebrahimi@google.com>2023-04-19 22:46:23 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2023-04-19 22:46:23 +0000
commit9fd19bc8546386c009b7ee3a683288cab3d6c6d4 (patch)
treef90515ae94afaa618d324bbb1def076f060da770
parent8bfa262070cbfd77635cfa7660c94e5b427f62ea (diff)
parentfcf9aa9c6eceff96326f3745e866b901757e04f2 (diff)
downloadexternal_updater-9fd19bc8546386c009b7ee3a683288cab3d6c6d4.tar.gz
Adding build option to upload parser am: 6d25fe394a am: 7c67510957 am: fcf9aa9c6e
Original change: https://android-review.googlesource.com/c/platform/tools/external_updater/+/2545190 Change-Id: Ifd084464bf139672efd7bd759788441e77a84dd2 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r--README.md6
-rw-r--r--external_updater.py9
-rw-r--r--updater_utils.py6
3 files changed, 21 insertions, 0 deletions
diff --git a/README.md b/README.md
index 345de8a..a6bf28f 100644
--- a/README.md
+++ b/README.md
@@ -28,6 +28,12 @@ Update a library on top of the local changes in the current branch, commit, and
tools/external_updater/updater.sh update --keep_local_changes ${LIBNAME}
```
+Update a library without building:
+
+```shell
+tools/external_updater/updater.sh update --no_build ${LIBNAME}
+```
+
LIBNAME can be the path to a library under external/, e.g. kotlinc, or
python/cpython3.
diff --git a/external_updater.py b/external_updater.py
index d147d13..fe03390 100644
--- a/external_updater.py
+++ b/external_updater.py
@@ -116,6 +116,11 @@ def _do_update(args: argparse.Namespace, updater: Updater,
fileutils.write_metadata(full_path, updated_metadata, args.keep_date)
git_utils.add_file(full_path, 'METADATA')
+ if args.build:
+ if not updater_utils.build(full_path):
+ print("Build failed. Aborting upload.")
+ return
+
if args.stop_after_merge:
return
@@ -310,6 +315,10 @@ def parse_args() -> argparse.Namespace:
update_parser.add_argument('--skip_post_update',
action='store_true',
help='Skip post_update script')
+ update_parser.add_argument('--no_build',
+ action='store_false',
+ dest='build',
+ help='Skip building'),
update_parser.add_argument('--remote_name',
default='aosp',
required=False,
diff --git a/updater_utils.py b/updater_utils.py
index 3960d76..b263dcb 100644
--- a/updater_utils.py
+++ b/updater_utils.py
@@ -128,3 +128,9 @@ def get_latest_version(current_version: str, version_list: List[str]) -> str:
if not latest:
raise ValueError('No matching version.')
return latest
+
+
+def build(proj_path: Path) -> None:
+ cmd = ['build/soong/soong_ui.bash', "--build-mode", "--modules-in-a-dir-no-deps", f"--dir={str(proj_path)}"]
+ print('Building...')
+ return subprocess.run(cmd, check=True, text=True)