-
Notifications
You must be signed in to change notification settings - Fork 48
/
dcrlibwallet-ci-build.sh
executable file
·46 lines (39 loc) · 1.2 KB
/
dcrlibwallet-ci-build.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
installGo(){
echo "Installing golang"
curl -O https://storage.googleapis.com/golang/go1.16.7.darwin-amd64.tar.gz
sha256sum go1.16.7.darwin-amd64.tar.gz
tar -xvf go1.16.7.darwin-amd64.tar.gz
sudo chown -R root:root ./go
sudo mv go /usr/local
}
installGobind(){
echo "Installing gobind"
export GO111MODULE=off
go get -u golang.org/x/mobile/cmd/gobind
}
installGomobile(){
echo "Installing gomobile"
export GO111MODULE=off
go get -u golang.org/x/mobile/cmd/gomobile
gomobile init
}
if !(hash go 2>/dev/null); then
installGo
fi
export GOPATH=$HOME/go
export PATH=$PATH:/usr/local/go/bin:$GOPATH/bin
if !(hash gobind 2>/dev/null); then
installGobind
fi
if !(hash gomobile 2>/dev/null); then
installGomobile
fi
go version
echo "Building dcrlibwallet"
export DcrandroidDir=$(pwd)
mkdir -p $GOPATH/src/github.com/planetdecred
git clone https://github.com/planetdecred/dcrlibwallet $GOPATH/src/github.com/planetdecred/dcrlibwallet
cd $GOPATH/src/github.com/planetdecred/dcrlibwallet
export GO111MODULE=on && go mod vendor && export GO111MODULE=off
gomobile bind -target=android/386
cp dcrlibwallet.aar $DcrandroidDir/app/libs/dcrlibwallet.aar && cd $DcrandroidDir