forked from ItsOnlyBinary/cm_build_scripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build_finish
46 lines (35 loc) · 1011 Bytes
/
build_finish
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
SCRIPT_HOME="$(dirname "$(which "$0")")"
source "$SCRIPT_HOME/config"
cd "$PROJECT_DIR"
## Find file name of ROM and set variable
FILE=$(ls $OUT_DIR/target/product/$ANDROID_DEVICE/cm-14.1-*.zip)
## Check if ROM exists before proceding
if [ ! -e "$FILE" ]; then
echo "Build Failed!"
exit
fi
echo "Build Successful!"
## Generate Last Build File with date of last commit
date -d "$(repo forall -c 'git log -1 --format=%cI' | sort | tail -1) + 1 second" -Iseconds > "$LAST_BUILD_FILE"
## Remove extension of file name and set variable
NOEXT=${FILE%\.*}
#echo ""
#echo "Removing previous builds on OTA REST Server."
#echo ""
#rm "$BUILDDIR"/full/cm-14.1-*
#echo "Copying ROM ($FILE) to OTA REST Server."
#echo ""
#cp "$FILE" "$BUILDDIR"/full/
#if [ -e "$CHANGE_FILE" ]; then
# echo "Copying changelog ($NOEXT.html) to OTA REST Server."
# echo ""
# cp "$CHANGE_FILE" "$BUILDDIR"/full/"$NOEXT".html
#else
# echo "Changelog not found!"
# echo ""
# exit
#fi
echo ""
echo "Done."
echo ""