-
Notifications
You must be signed in to change notification settings - Fork 5
/
build.sh
executable file
·69 lines (58 loc) · 2.24 KB
/
build.sh
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
echo " _____ _ _ _ __ __ "
echo " | ____|_ _____ | |_ _| |_(_) ___ _ __ \ \/ / "
echo " | _| \ \ / / _ \| | | | | __| |/ _ \| '_ \ \ / "
echo " | |___ \ V / (_) | | |_| | |_| | (_) | | | | / \ "
echo " |_____| \_/ \___/|_|\__,_|\__|_|\___/|_| |_| /_/\_\ "
echo " "
ROOT_DIR="$(pwd)"
cd $ROOT_DIR
EVO_VERSION="$(awk '/EVO_VERSION := / {print $3}' $ROOT_DIR/vendor/lineage/config/version.mk)"
echo "Building Evolution X version $EVO_VERSION"
echo "---------------------------"
source build/envsetup.sh
ccache -M 50G -F 0
START_TIME=$(date +%s)
RELEASE_DATE=$(date +%Y%m%d)
RELEASE_DATE_FMT=$(date +%Y-%m-%d)
cd ~/evo
compress() {
echo "----- Compressing the variant -----"
cd $ROOT_DIR/out/target/product/tdgsi_arm64_ab
xz -9 -T0 -v -z system.img
mv system.img.xz $HOME/Downloads/evolution_arm64_bgN$variant-$EVO_VERSION-unofficial-$RELEASE_DATE.img.xz
}
echo "----- Building slim variant -----"
variant="_slim"
cd $ROOT_DIR
lunch treble_arm64_bgN_slim-userdebug
make systemimage -j$(nproc --all)
compress
echo "----- Building normal variant -----"
variant=""
cd $ROOT_DIR
lunch treble_arm64_bgN-userdebug
make systemimage -j$(nproc --all)
compress
echo "----- Done! -----"
echo "Start time: $START_TIME"
slim_size=$(wc -c < $HOME/Downloads/evolution_arm64_bgN_slim-$EVO_VERSION-unofficial-$RELEASE_DATE.img.xz)
echo "Slim size: $slim_size"
normal_size=$(wc -c < $HOME/Downloads/evolution_arm64_bgN-$EVO_VERSION-unofficial-$RELEASE_DATE.img.xz)
echo "Normal size: $normal_size"
echo "----- OTA -----"
echo "{
\"version\": \"$RELEASE_DATE_FMT (Evolution X $EVO_VERSION)\",
\"date\": \"$START_TIME\",
\"variants\": [
{
\"name\": \"treble_arm64_bgN\",
\"size\": \"$normal_size\",
\"url\": \"https://github.com/mytja/treble_evo/releases/download/$RELEASE_DATE/evolution_arm64_bgN-$EVO_VERSION-unofficial-$RELEASE_DATE.img.xz\"
},
{
\"name\": \"treble_arm64_bgN_slim\",
\"size\": \"$slim_size\",
\"url\": \"https://github.com/mytja/treble_evo/releases/download/$RELEASE_DATE/evolution_arm64_bgN_slim-$EVO_VERSION-unofficial-$RELEASE_DATE.img.xz\"
}
]
}"