-
Notifications
You must be signed in to change notification settings - Fork 2
/
prebuild.sh
executable file
·43 lines (33 loc) · 989 Bytes
/
prebuild.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
#!/bin/bash
set -e
if [ ! -d "Build" ]; then
mkdir Build
fi
cd Build
# Clone repository if it does not exist
if [ ! -d "rarime-mobile-identity-sdk" ]; then
echo "⏳ Cloning the repository"
git clone [email protected]:rarimo/rarime-mobile-identity-sdk.git
fi
# Pull latest changes
echo "⏳ Pulling latest changes"
cd rarime-mobile-identity-sdk
git stash
git pull origin main
cd ..
# Remove existing builds
echo "⏳ Removing existing builds"
rm -rf rarime-mobile-identity-sdk/Frameworks/Identity.xcframework
rm -rf ../Frameworks/Identity.xcframework
# Run build script
export PATH="$PATH:/usr/local/go/bin/"
export PATH="$PATH:$HOME/go/bin"
echo "⏳ Building SDK"
cd rarime-mobile-identity-sdk
go get -u golang.org/x/mobile/bind
gomobile bind -target ios -o ./Frameworks/Identity.xcframework
# Move built framework to the root directory
cd ..
mv rarime-mobile-identity-sdk/Frameworks/Identity.xcframework ../Frameworks/
echo "✅ Build completed successfully"
exit 0