mirror of
https://github.com/chararomandroid/android_device_samsung_a20
synced 2026-08-21 19:55:33 -04:00
universa7885: add simple build script
This commit is contained in:
parent
bb57031b9e
commit
7330e6416a
2 changed files with 54 additions and 1 deletions
53
build.sh
Normal file
53
build.sh
Normal file
|
|
@ -0,0 +1,53 @@
|
|||
#!/bin/bash
|
||||
# Logic here:
|
||||
# Target devices: a10, a20, a20e, a30, a40, or all (LOWERCASE)
|
||||
# Target : e.g. bacon, otapackage
|
||||
# Usage ./build.sh a10 a20e bacon
|
||||
|
||||
# Export Telegram variables
|
||||
CHAT_ID=-1001207057155
|
||||
BOT_TOKEN=5068662666:AAH4nY3MIcx_kBCZKnAVDsLstylvt50nlHA
|
||||
|
||||
VENDOR=$(cat device/samsung/universal7885-common/vendor_name)
|
||||
if [ ! $VENDOR ]; then
|
||||
VENDOR=aosp;
|
||||
fi
|
||||
# Telegram functions.
|
||||
function tg_sendText() {
|
||||
curl -s "https://api.telegram.org/bot$BOT_TOKEN/sendMessage" \
|
||||
-d "parse_mode=html" \
|
||||
-d text="${@}" \
|
||||
-d chat_id=$CHAT_ID \
|
||||
-d "disable_web_page_preview=true"
|
||||
}
|
||||
function tg_sendFile() {
|
||||
curl -s "https://api.telegram.org/bot$BOT_TOKEN/sendDocument" \
|
||||
-F parse_mode=markdown \
|
||||
-F chat_id=$CHAT_ID \
|
||||
-F document=@${1} \
|
||||
-F "caption=$POST_CAPTION"
|
||||
}
|
||||
|
||||
if [ "$#" -lt 2 ]; then
|
||||
tg_sendText "Illegal number of parameters ($#)"
|
||||
exit 1
|
||||
fi
|
||||
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";
|
||||
else
|
||||
tg_sendText "$VENDOR $i lunch fail";
|
||||
exit 1;
|
||||
fi
|
||||
tg_sendText "$VENDOR $i build...";
|
||||
if m $TARGET; then
|
||||
tg_sendText "$VENDOR $i finish";
|
||||
else
|
||||
tg_sendText "$VENDOR $i failed";
|
||||
exit 1;
|
||||
fi
|
||||
done
|
||||
|
||||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in a new issue