forked from BlinkID/blinkid-flutter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
initFlutterSample.sh
executable file
·65 lines (48 loc) · 1.78 KB
/
initFlutterSample.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
#!/bin/bash
appName=sample
# remove any existing code
rm -rf $appName
# create a sample application
flutter create -a java --org com.microblink $appName
# enter into demo project folder
pushd $appName
IS_LOCAL_BUILD=false || exit 1
if [ "$IS_LOCAL_BUILD" = true ]; then
# add blinkid_flutter dependency with local path to pubspec.yaml
perl -i~ -pe "BEGIN{$/ = undef;} s/dependencies:\n flutter:\n sdk: flutter/dependencies:\n flutter:\n sdk: flutter\n blinkid_flutter:\n path: ..\/BlinkID\n image_picker: 1.0.0/" pubspec.yaml
echo "Using blinkid_flutter from this repo instead from flutter pub"
else
# add blinkid_flutter dependency to pubspec.yaml
perl -i~ -pe "BEGIN{$/ = undef;} s/dependencies:\n flutter:\n sdk: flutter/dependencies:\n flutter:\n sdk: flutter\n blinkid_flutter:\n image_picker: 1.0.0/" pubspec.yaml
echo "Using blinkid_flutter from flutter pub"
fi
flutter pub get
# enter into android project folder
pushd android
popd
# enter into ios project folder
pushd ios
#Force minimal iOS version
sed -i '' "s/# platform :ios, '12.0'/platform :ios, '13.0'/" Podfile
# install pod
pod install
if false; then
echo "Replace pod with custom dev version of BlinkID framework"
pushd Pods/PPBlinkID
rm -rf Microblink.bundle
rm -rf Microblink.framework
cp -r ~/Downloads/blinkid-ios/Microblink.bundle ./
cp -r ~/Downloads/blinkid-ios/Microblink.framework ./
popd
fi
# go to flutter root project
popd
cp ../sample_files/main.dart lib/
echo ""
echo "Go to Flutter project folder: cd $appName"
echo "To run on Android type: flutter run"
echo "To run on iOS:
1. Open $appName/ios/Runner.xcworkspace
2. Set your development team
3. Add Privacy - Camera Usage Description & Privacy - Photo Library Usage Description keys to Runner/Info.plist file
4. Press run"