forked from wHo-EM-i/ci-build
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild
More file actions
87 lines (77 loc) · 2.06 KB
/
Copy pathbuild
File metadata and controls
87 lines (77 loc) · 2.06 KB
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
#!/bin/bash
cd /tmp/rom # Depends on where source got synced
. /tmp/ci/function && check_build_type
# Normal build steps
. build/envsetup.sh
lunch $lunch_device
case "$build_type" in
R|r)
export _JAVA_OPTIONS="-Xmx10g"
esac
export CCACHE_DIR=/tmp/ccache
export CCACHE_EXEC=$(which ccache)
export USE_CCACHE=1
ccache -M 15G
ccache -o compression=true
ccache -z
# check how much time sync took
sync_time
# compile plox
case "$build_type" in
V|v) # Lets Make Vendor / System
SECONDS=0
make vendorimage -j$(nproc --all)
vendor_time=$(($SECONDS / 60))
sleeps=$((113 - ($vendor_time + $sync_time)))m
make systemimage -j$(nproc --all) | tee build.log &
sleep $sleeps
kill %1
;;
S|s) # Lets Make System
sleeps=$((113 - $sync_time))m
make systemimage -j$(nproc --all) | tee build.log &
sleep $sleeps
kill %1
;;
R|r) # Lets Make Full Rom
bash /tmp/ci/build.sh || bash /tmp/ci/build.sh
if [ -e out/target/product/$device_codename/*$device_codename*2022*zip ]; then # to bypass OOM kill
bash /tmp/ci/build.sh || bash /tmp/ci/build.sh # simply re-run the build
fi
esac
if [ -e out/target/product/$device_codename/system.img ]; then
echo "R" > /tmp/build_type.txt
else
echo "S" > /tmp/build_type.txt
fi
cd out/target/product/$device_codename
rom_zip=`ls *$device_codename*2022*.zip`
if [ $rom_zip ]; then
upload $rom_zip
case "$upload_type" in
1) # github
tg "Build Succeed!
Time Took: $(($SECONDS / 60))min and $(($SECONDS % 60))sec.
github link: $github_url"
;;
2) # gdrive
tg "Build Succeed!
Time Took: $(($SECONDS / 60))min and $(($SECONDS % 60))sec.
gdrive link: $gdrive_url"
;;
3) # both
tg "Build Succeed!
Time Took: $(($SECONDS / 60))min and $(($SECONDS % 60))sec.
gdrive link: $gdrive_url
github link: $github_url"
;;
*) # default is gdrive
tg "Build Succeed!
Time Took: $(($SECONDS / 60))min and $(($SECONDS % 60))sec.
gdrive link: $gdrive_url"
esac
else
tg "Stop Compiling $build_type Img To Collect Cache
Status: $progress"
fi
ccache -s # Let's print ccache statistics finally