-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild_android.sh
51 lines (37 loc) · 1.26 KB
/
build_android.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
#!/bin/bash
cd "`dirname \"$0\"`"
export REPOROOT=$(pwd)
export GOPATH=$REPOROOT/.build
export GOBIN=$GOPATH/bin
export PATH=$GOBIN:$PATH
export ANDROID_NDK_HOME=$ANDROID_HOME/ndk-bundle
set -v
go version
mkdir -p $GOPATH
go get -d -v github.com/lightninglabs/falafel
cd $GOPATH/src/github.com/lightninglabs/falafel
go install
cd $REPOROOT
go get -v golang.org/x/tools/cmd/goimports
go get -d -v golang.org/x/tools/go/packages
go get -d -v golang.org/x/mobile/cmd/gomobile
cd $GOPATH/src/golang.org/x/mobile/cmd/gomobile
go install
cd $REPOROOT
go get -d -v github.com/grpc-ecosystem/grpc-gateway/third_party/googleapis
go get -d -v github.com/lightningnetwork/lnd
# install grpc
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.8.0/protoc-3.8.0-linux-x86_64.zip
unzip protoc-3.8.0-linux-x86_64.zip -d protoc
rm protoc-3.8.0-linux-x86_64.zip
export PATH=$PWD/protoc/bin:$PATH
# lnd
gomobile init
cd $GOPATH/src/github.com/lightningnetwork/lnd
git checkout v0.9.0-beta
git apply $REPOROOT/patches/user_agent_name.patch
git apply $REPOROOT/patches/user_agent_version.patch
make GOPATH=$GOPATH ANDROID_BUILD_DIR=$REPOROOT android
cd $REPOROOT
zip --symlinks -r Lndmobile-android.zip Lndmobile.aar Lndmobile-sources.jar
rm Lndmobile.aar Lndmobile-sources.jar