-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathscript.sh
More file actions
executable file
·115 lines (105 loc) · 2.38 KB
/
script.sh
File metadata and controls
executable file
·115 lines (105 loc) · 2.38 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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
# function env wich take string project as an argument and copy .env.project to .env
function env {
echo "env"
if [ -f ".env.$1" ]; then
cp ".env.$1" ".env"
chmod g-w ".env"
echo "copy .env.$1 to .env"
else
echo "file .env.$1 not found"
fi
if [ -f "android/key.properties.$1" ]; then
cp "android/key.properties.$1" "android/key.properties"
chmod g-w "android/key.properties"
echo "copy android/key.properties.$1 to android/key.properties"
else
echo "file android/key.properties.$1 not found"
fi
}
function pub {
flutter clean
for d in `ls packages`;
do
(
cd "packages/$d"
flutter clean
flutter pub get
flutter pub upgrade
flutter packages upgrade
)
done
flutter pub get
flutter pub upgrade
flutter packages upgrade
}
function buildRunner {
echo "build_runner"
for d in `ls packages`;
do
(
echo "$d"
cd "packages/$d"
dart run build_runner build --delete-conflicting-outputs
)
done
dart run build_runner build --delete-conflicting-outputs
flutter pub get
}
function podUpdate {
echo "pod install"
cd ios
rm Podfile.lock
pod install
pod update
cd ..
}
if [[ "$*" == *-runDev* ]];
then
echo "flutter run development"
flutter run --flavor development --target lib/main_development.dart
elif [[ "$*" == *-runstage* ]];
then
echo "flutter run staging"
flutter run --flavor staging --target lib/main_staging.dart
elif [[ "$*" == *-run* ]];
then
echo "flutter run production"
flutter run --flavor production --target lib/main_production.dart
elif [[ "$*" == *-pod* ]];
then
podUpdate
elif [[ "$*" == *-android* ]];
then
pub
buildRunner
echo "deploy android"
echo "Make sure you are in right branch"
flutter build appbundle --flavor "production" --target "lib/main_production.dart"
# cd android
# fastlane deploy
echo "app bundle deployed on internal testing track"
elif [[ "$*" == *-ios* ]];
then
pub
buildRunner
podUpdate
echo "deploy ios"
echo "Make sure you are in right branch"
flutter build ios --release --flavor "production" --target "lib/main_production.dart"
cd ios
fastlane beta
elif [[ "$*" == *-pub* ]];
then
pub
elif [[ "$*" == *-main* ]];
# call env function with main as project
then
env main
elif [[ "$*" == *-COMP* ]];
# call env function with COMP as project
then
env COMP
else
pub
buildRunner
fi