diff options
author | Joel Galenson <jgalenson@google.com> | 2021-05-07 15:05:53 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-05-07 15:05:53 +0000 |
commit | 08af5ca7e71a151e9a7403c50884850a30e5cbbc (patch) | |
tree | c2b088103d9bf96628406dcab0ee6048cfc04dfb | |
parent | d6ac467df881058edd75ffa7bc0888f250652af0 (diff) | |
parent | 810722d6d0055d2de85d04d598f331abcf9530da (diff) | |
download | external_updater-08af5ca7e71a151e9a7403c50884850a30e5cbbc.tar.gz |
Merge "Use a wrapper around cargo2android.py."
-rwxr-xr-x | regen_bp.sh | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/regen_bp.sh b/regen_bp.sh index 963442b..c84ff53 100755 --- a/regen_bp.sh +++ b/regen_bp.sh @@ -24,13 +24,16 @@ set -e +# Wrapper around cargo2android. +C2A_WRAPPER="/google/bin/releases/android-rust/cargo2android/sandbox.par" + function main() { check_files $* update_files_with_cargo_pkg_vars # Save Cargo.lock if it existed before this update. [ ! -f Cargo.lock ] || mv Cargo.lock Cargo.lock.saved - echo "Updating Android.bp: $C2A $FLAGS" - $C2A $FLAGS + echo "Updating Android.bp: $C2A_WRAPPER -- $FLAGS" + $C2A_WRAPPER -- $FLAGS copy_cargo_out_files $* rm -rf target.tmp cargo.out Cargo.lock # Restore Cargo.lock if it existed before this update. @@ -45,13 +48,10 @@ function abort() { function check_files() { if [ "$1" == "" ]; then EXTERNAL_DIR=`pwd` - C2A=`which cargo2android.py || - abort "ERROR: cannot find cargo2android.py in PATH"` else EXTERNAL_DIR="$2" # e.g. rust/crates/bytes - C2A="$1/development/scripts/cargo2android.py" - [ -f "$C2A" ] || abort "ERROR: cannot find $C2A" fi + [ -f "$C2A_WRAPPER" ] || abort "ERROR: cannot find $C2A_WRAPPER" LINE1=`head -1 Android.bp || abort "ERROR: cannot find Android.bp"` if [[ ! "$LINE1" =~ ^.*cargo2android.py.*$ ]]; then echo 'Android.bp header does not contain "cargo2android.py"; skip regen_bp' |