-
Notifications
You must be signed in to change notification settings - Fork 25
/
build.sh
74 lines (59 loc) · 1.13 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
70
71
72
73
74
#!/usr/bin/env bash
help() {
echo "Accepted arguments: ios, apk, bundle, android, all"
exit
}
if [ $# -lt 1 ]
then
echo "$0 Not enough arguments"
help
fi
apk() {
echo "Building apk(s)..."
flutter build apk --target-platform android-arm64 --split-per-abi --obfuscate --split-debug-info=./debugInfo/apk
flutter build apk --target-platform android-arm --split-per-abi --obfuscate --split-debug-info=./debugInfo/apk
flutter build apk --target-platform android-x64 --split-per-abi --obfuscate --split-debug-info=./debugInfo/apk
echo "Done"
}
aab() {
echo "Building aab..."
flutter build appbundle --obfuscate --split-debug-info=./debugInfo/aab
echo "Done"
}
android() {
echo "Building for android..."
apk
aab
}
ios() {
echo "Building for ios..."
flutter build ios --release
echo "More steps from xcode required"
echo "For more info, please visit: https://flutter.dev/docs/deployment/ios"
echo "Done"
}
all() {
echo "Building for all (ios, apk, aab)"
android
ios
}
case $1 in
"apk")
apk
;;
"bundle")
aab
;;
"android")
android
;;
"ios")
ios
;;
"all")
all
;;
*)
help
;;
esac