diff options
| author | 2020-04-14 15:32:55 -0700 | |
|---|---|---|
| committer | 2020-04-15 03:06:11 +0000 | |
| commit | b9602bc0d9a3e3ac2b8a65dfa5f26fb2e2e71d1e (patch) | |
| tree | 55c0397e321180628902b9c689c695b2133f4ff7 | |
| parent | 4947356664460557c196b6efbf6f7f64f41031f4 (diff) | |
Fork off update_shared_lib.sh to update_statsd_lib.sh
Test: script works!
Bug: 144953948
Change-Id: I2b4200f97431e0e45d371ef74b885ff25e55cb86
| -rwxr-xr-x | packages/SystemUI/scripts/update_statsd_lib.sh | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/packages/SystemUI/scripts/update_statsd_lib.sh b/packages/SystemUI/scripts/update_statsd_lib.sh new file mode 100755 index 000000000000..79b9497a5f3f --- /dev/null +++ b/packages/SystemUI/scripts/update_statsd_lib.sh @@ -0,0 +1,35 @@ +#!/bin/sh + +NUM_ARGS=$# +JAR_DESTINATION="$1/prebuilts/framework_intermediates/libs/systemui_statsd.jar" + +has_croot() { + declare -F croot > /dev/null + return $? +} + +check_environment() { + if ! has_croot; then + echo "Run script in a shell that has had envsetup run. Run '. update_statsd_lib.sh' from scripts directory" + return 1 + fi + + if [ $NUM_ARGS -ne 1 ]; then + echo "Usage: . update_statsd_lib.sh PATH_TO_UNBUNDLED_LAUNCER e.g. . update_statsd_lib ~/src/ub-launcher3-master" + return 1 + fi + return 0 +} + +main() { + if check_environment ; then + pushd . + croot + mma -j16 SystemUI-statsd + cp out/target/product/$TARGET_PRODUCT/obj/JAVA_LIBRARIES/SystemUI-statsd_intermediates/javalib.jar $JAR_DESTINATION + popd + fi +} + +main + |