This repository was archived by the owner on Feb 16, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sh
More file actions
executable file
·93 lines (58 loc) · 2.08 KB
/
build.sh
File metadata and controls
executable file
·93 lines (58 loc) · 2.08 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
88
89
90
91
92
93
#!/bin/bash
LICENSE_FILE="src/res/licenses.txt"
BUILD_ID_FILE="src/res/build_id.txt"
declare -a LICENSE_URLS=("https://raw.githubusercontent.com/kivy/python-for-android/develop/LICENSE" "https://raw.githubusercontent.com/kivy/pyjnius/master/LICENSE" "https://raw.githubusercontent.com/kivy/kivy/master/LICENSE" "https://raw.githubusercontent.com/kivymd/KivyMD/master/LICENSE" "https://raw.githubusercontent.com/psf/requests/main/LICENSE" "https://raw.githubusercontent.com/python/cpython/main/LICENSE")
declare -a LICENSE_NAMES=("Python For Android" "pyjnius" "Kivy" "KivyMD" "requests" "Python")
echo -------------------
echo Build ID: $(git log -n 1 --pretty=format:"%H")
echo -------------------
echo $(git log -n 1 --pretty=format:"%H") > ${BUILD_ID_FILE}
echo -------------------
echo Pulling licenses...
echo -------------------
COUNT=0
#Clear license file
echo "" > ${LICENSE_FILE}
for I in "${LICENSE_URLS[@]}"
do
echo -en "\r\033[KPulling license $((COUNT+1))/${#LICENSE_URLS[@]}"
echo -e "\n" >> ${LICENSE_FILE}
echo -e "-------------\n" >> "${LICENSE_FILE}"
echo -e "\n" >> ${LICENSE_FILE}
echo -e "${LICENSE_NAMES[$COUNT]}\n" >> "${LICENSE_FILE}"
echo -e "\n" >> ${LICENSE_FILE}
echo -e "-------------\n" >> "${LICENSE_FILE}"
echo -e "\n" >> ${LICENSE_FILE}
echo "$(curl -s $I)\n" >> "${LICENSE_FILE}"
((COUNT++))
done
echo -e "\nDone!"
if [ "$1" == "res" ]
then
echo "Skipping APK build..."
echo "Finished"
exit
fi
echo -------------------
echo Building APK and deploying...
echo -------------------
if [ "$1" == "debug" ]
then
buildozer android debug deploy run
elif [ "$1" == "release" ]
then
if [[ ! -e "uber-apk-signer*.apk" ]]; then
echo "Building release APK..."
buildozer android release
echo "Signing the APK(s)..."
java -jar $(find ./ -name "uber-apk-signer*.jar" -print -quit) --apks ./bin/
else
echo "Unable to find uber-apk-signer!"
exit
fi
else
echo "Invalid option '$1'"
fi
echo -------------------
echo Finished
echo -------------------