forked from planetdecred/dcrios
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild_wallet_framework.sh
executable file
·57 lines (49 loc) · 1.23 KB
/
build_wallet_framework.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
#!/bin/bash
export LIB_DIR=$(pwd)/libs
export DCRLIBWALLET_GIT_DIR=$GOPATH/src/github.com/raedahgroup/dcrlibwallet
main() {
if [ -e $DCRLIBWALLET_GIT_DIR ]
then
echo "dcrlibwallet git folder found, running git pull"
updateDcrlibwallet;
else
echo "dcrlibwallet git folder does not exist, running git clone"
cloneDcrlibwallet;
fi
echo "building dcrlibwallet"
buildDcrlibwallet;
echo "copying built binary"
copyLibrary;
}
cloneDcrlibwallet() {
rm -rf $DCRLIBWALLET_GIT_DIR
mkdir -p $DCRLIBWALLET_GIT_DIR
git clone https://github.com/raedahgroup/dcrlibwallet.git $DCRLIBWALLET_GIT_DIR
# update with the appropriate tag/commit hash to checkout
git checkout v1.0.0
echo "done cloning dcrlibwallet"
}
updateDcrlibwallet() {
cd $DCRLIBWALLET_GIT_DIR
git fetch
# update with the appropriate tag/commit hash to checkout
git checkout v1.0.0
echo "done updating dcrlibwallet"
}
buildDcrlibwallet() {
cd $DCRLIBWALLET_GIT_DIR
rm -rf Dcrlibwallet.framework/
export GO111MODULE=on
go mod download
go mod vendor
export GO111MODULE=off
gomobile bind -target=ios
echo "done building dcrlibwallet"
}
copyLibrary() {
rm -rf $LIB_DIR
mkdir $LIB_DIR
cp -R -f Dcrlibwallet.framework $LIB_DIR/Dcrlibwallet.framework
echo "done"
}
main