This repository has been archived by the owner on May 10, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 183
/
build
executable file
·56 lines (46 loc) · 2.41 KB
/
build
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
#!/bin/bash
cd /tmp/rom # Depends on where source got synced
# Normal build steps
. build/envsetup.sh
lunch aosp_mido-user
export CCACHE_DIR=/tmp/ccache
export CCACHE_EXEC=$(which ccache)
export USE_CCACHE=1
ccache -M 20G # It took only 6.4GB for mido
ccache -o compression=true # Will save times and data to download and upload ccache, also negligible performance issue
ccache -z # Clear old stats, so monitor script will provide real ccache statistics
# Next 8 lines should be run first to collect ccache and then upload, after doning it 1 or 2 times, our ccache will help to build without these 8 lines.
#make api-stubs-docs || echo no problem, we need ccache
#make system-api-stubs-docs || echo no problem we need ccache
#make test-api-stubs-docs || echo no problem, we need ccache
#make aex -j10 & # dont remove that '&'
#sleep 85m
#kill %1
#ccache -s
#and dont use below codes for first 1 or 2 times, to get ccache uploaded,
# upload function for uploading rom zip file! I don't want unwanted builds in my google drive haha!
up(){
curl --upload-file $1 https://transfer.sh/$(basename $1); echo
# 14 days, 10 GB limit
}
# It's recommended to use google drive(rclone) as upload solution for coping with the time limit. Un-comment next 3 lines to upload with rclone in drive. Also change apon and junk according to your config name, uploading folder of drive
#up(){
# time rclone copy $1 apon:junk -P # apon is my rclone config name,
#}
tg(){
bot_api=1692865707:AAHvKZogI5sUGtqjd2sZvNl8tib0Q_xcYkY # Your tg bot api, dont use my one haha, it's better to encrypt bot api too.
your_telegram_id=$1 # No need to touch
msg=$2 # No need to touch
curl -s "https://api.telegram.org/bot${bot_api}/sendmessage" --data "text=$msg&chat_id=${your_telegram_id}"
}
id=571213272 # Your telegram id
# Upload rom zip file if succeed to build! Send notification to tg! And send shell to tg if build fails!
# Let's compile by parts! Coz of ram issue!
make api-stubs-docs || echo no problem
make system-api-stubs-docs || echo no problem
make test-api-stubs-docs || echo no problem
make aex -j10 \
&& send_zip=$(up out/target/product/mido/*zip) && tg $id "Build Succeed!
$send_zip" \
|| tmate -S /tmp/tmate.sock new-session -d && tmate -S /tmp/tmate.sock wait tmate-ready && send_shell=$(tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}') && tg $id "Build Failed" && tg $id "$send_shell" && ccache -s && sleep 2h
ccache -s # Let's print ccache statistics finally