-
-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathipa.sh
executable file
·36 lines (32 loc) · 1.05 KB
/
ipa.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
#!/bin/bash
# Check if the flavor argument is provided
if [ $# -eq 0 ]; then
echo "Usage: $0 <flavor>"
exit 1
fi
FLAVOR=$1
version=$(head -n 5 pubspec.yaml | tail -n 1 | cut -d ' ' -f 2)
appname=$(head -n 1 pubspec.yaml | cut -d ' ' -f 2)
echo "Building $appname version $version for $FLAVOR"
case $FLAVOR in
dev)
flutter build ios --release --no-codesign --flavor dev --dart-define-from-file env/dev.json -t lib/main.dart \
&& mkdir build/Payload \
&& cp -r build/ios/Release-dev-iphoneos/Boorusama-DEV.app/ build/Payload/Boorusama-DEV.app/ \
&& cd build \
&& zip -ro ${appname}_${version}-dev.ipa Payload \
&& rm -rf Payload
;;
prod)
flutter build ios --release --no-codesign --flavor prod --dart-define-from-file env/prod.json -t lib/main.dart \
&& mkdir build/Payload \
&& cp -r build/ios/Release-prod-iphoneos/Boorusama.app/ build/Payload/Boorusama.app/ \
&& cd build \
&& zip -ro ${appname}_${version}.ipa Payload \
&& rm -rf Payload
;;
*)
echo "Invalid flavor provided"
exit 1
;;
esac