blob: 8631b45640ab7b9a220d2446481f016bae3e48ba (
plain)
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
GO_VERSION=go1.12.7.linux-amd64
EXPECTED_FP=66d83bfb5a9ede000e33c6579a91a29e6b101829ad41fffb5c5bb6c900e109d9
if [[ $(ls -A ${GO_VERSION}.tar.gz) ]]
then
echo "reusing downloaded golang bundle"
else
echo "installing go lang bundle ${GO_VERSION}.tar.gz"
curl -o $GO_VERSION.tar.gz https://dl.google.com/go/$GO_VERSION.tar.gz
ACTUAL_FP=`sha256sum $GO_VERSION.tar.gz | cut -d " " -f1`
if [[ ! $ACTUAL_FP == $EXPECTED_FP ]]
then
echo "Download seems to be corrupted. Cancelling build."
return 1
fi
fi
if [[ -d ./golang ]]
then
if [[ $(ls -A ./golang/*) ]]
then
rm -r ./golang/*
fi
else
mkdir ./golang
fi
tar -C ./golang -xzf $GO_VERSION.tar.gz
export GOPATH=`pwd`
export GO_LANG=`pwd`/golang/go/bin
export GO_COMPILED=`pwd`/bin
export PATH="${GO_LANG}:${GO_COMPILED}:${PATH}"
./golang/go/bin/go get golang.org/x/mobile/cmd/gomobile
./golang/go/bin/go env
echo "getting gomobile..."
./golang/go/bin/go get golang.org/x/mobile/cmd/gomobile
echo "initiating gomobile..."
./bin/gomobile init
|