From 1bddc849816f594f6c706d8c514a0aaf399b15dd Mon Sep 17 00:00:00 2001 From: roynatech2544 Date: Tue, 18 Jan 2022 07:03:42 +0900 Subject: [PATCH] [SQUASH] build.sh: Fix issues implement functions build.sh: Fix not sourcing build/envsetup.sh build.sh: use curly braces build.sh: implement time diff build.sh: Fix my stupid syntax error build.sh: Fix my stupid syntax error v2 build.sh: implement error log sender build.sh: NO SPAM SIR build.sh: stylish build.sh: missCCC --- build.sh | 35 +++++++++++++++++++---------- universal7885-common/vendorsetup.sh | 2 +- 2 files changed, 24 insertions(+), 13 deletions(-) mode change 100644 => 100755 build.sh diff --git a/build.sh b/build.sh old mode 100644 new mode 100755 index 318cdf3..957f43b --- a/build.sh +++ b/build.sh @@ -32,22 +32,33 @@ if [ "$#" -lt 2 ]; then tg_sendText "Illegal number of parameters ($#)" exit 1 fi +. build/envsetup.sh TARGET=${*%${!#}} -tg_sendText "VENDOR = $VENDOR, Devices = ${@:$#}, Build Target=$TARGET" -for i in TARGET; do -tg_sendText "$VENDOR $i lunch..."; -if lunch $VENDOR_$i-user; then -tg_sendText "$VENDOR $i lunch success"; +if [ "$1" == "all" ]; then +TARGET="a10 a20 a20e a30 a40" +fi +tg_sendText "[Vendor = $VENDOR], [Devices = $TARGET], [Build Target=${@:$#}]" +for i in $TARGET; do +start=`date +%s` +tg_sendText "[$VENDOR][$i] lunch..."; +if lunch ${VENDOR}_${i}-user; then +tg_sendText "[$VENDOR][$i] lunch success"; else -tg_sendText "$VENDOR $i lunch fail"; +tg_sendText "[$VENDOR][$i] lunch failed"; exit 1; fi -tg_sendText "$VENDOR $i build..."; -if m $TARGET; then -tg_sendText "$VENDOR $i finish"; -else -tg_sendText "$VENDOR $i failed"; +tg_sendText "[$VENDOR][$i] start build..."; +if ! m ${@:$#}; then +end=`date +%s` +secs=$((end-start)) +tg_sendText "[$VENDOR][$i] fail in $((secs/3600)) Hours $((secs%3600/60)) Minutes $((secs%60)) Seconds"; +if [ -e out/error.log ]; then +tg_sendFile "out/error.log" +fi exit 1; fi +end=`date +%s` +secs=$((end-start)) +tg_sendText "[$VENDOR][$i] success in $((secs/3600)) Hours $((secs%3600/60)) Minutes $((secs%60)) Seconds" done - +tg_sendText "All done" diff --git a/universal7885-common/vendorsetup.sh b/universal7885-common/vendorsetup.sh index 5be6467..5e6f591 100644 --- a/universal7885-common/vendorsetup.sh +++ b/universal7885-common/vendorsetup.sh @@ -27,4 +27,4 @@ echo "Generating A30 Makefiles" ./device/samsung/a30/setup.sh echo "Generating A40 Makefiles" ./device/samsung/a40/setup.sh -ln -s device/samsung/universal7885-common/build.sh +ln -sf device/samsung/build.sh