Update the update_prebuilt script am: fb4c1ad7b7
Original change: https://android-review.googlesource.com/c/platform/packages/modules/SdkExtensions/+/1607635
MUST ONLY BE SUBMITTED BY AUTOMERGER
Change-Id: I4eb972e424fa787af3b2694099c15ea13c014536
diff --git a/testing/update_prebuilt.sh b/testing/update_prebuilt.sh
index 4c0d530..986258c 100755
--- a/testing/update_prebuilt.sh
+++ b/testing/update_prebuilt.sh
@@ -1,7 +1,8 @@
#!/bin/bash -ex
# This script updates the prebuilt test_framework-sdkextension.jar, which is
-# required when the "new APIs" added change.
+# required when the "new APIs" added change, or the framework jar changes
+# for other reasons.
function gettop() {
local p=$(pwd)
@@ -11,35 +12,25 @@
echo $(readlink -f $p)
}
-function is_aosp() {
- grep -q 'https://android-review.googlesource.com' $(gettop)/.repo/manifests/default.xml
-}
-
if [[ -z "$OUT" ]]; then
echo "lunch first"
exit 1
fi
dir=$(dirname $(readlink -f $BASH_SOURCE))
-bps="${dir}/../framework/Android.bp"
-# AOSP does not use combined stubs, so needs special treatment.
-if is_aosp; then
- bps="$bps $(gettop)/frameworks/base/Android.bp"
-fi
+bp="${dir}/../framework/Android.bp"
-for bp in $bps; do
- if ! test -e $bp; then
- echo $bp does not exist
- exit 1
- elif test -e "${bp}.bak"; then
- echo "skipping ${bp} modification because ${bp}.bak exists"
- continue
- fi
- cp $bp "${bp}.bak"
- sed -i -e 's|":framework-sdkextensions-sources"|":framework-sdkextensions-sources",":test_framework-sdkextensions-sources"|' $bp
-done
+if ! test -e $bp; then
+ echo $bp does not exist
+ exit 1
+elif test -e "${bp}.bak"; then
+ echo "skipping ${bp} modification because ${bp}.bak exists"
+ continue
+fi
+cp $bp "${bp}.bak"
+sed -i -e 's|":framework-sdkextensions-sources"|":framework-sdkextensions-sources",":test_framework-sdkextensions-sources"|' $bp
$(gettop)/build/soong/soong_ui.bash --make-mode framework-sdkextensions
-for bp in $bps; do mv "${bp}.bak" $bp ; touch $bp; done
+mv "${bp}.bak" $bp ; touch $bp
cp "${OUT}/apex/com.android.sdkext/javalib/framework-sdkextensions.jar" "${dir}/test_framework-sdkextensions.jar"