Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build using go tools instead of xgo #404

Merged
merged 1 commit into from
Aug 29, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 14 additions & 8 deletions scripts/build-cli.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
#!/bin/bash -e

go get ./...
go get github.com/karalabe/xgo
mkdir bin
xgo --targets=darwin/386,darwin/amd64,linux/386,linux/amd64,windows/386,windows/amd64 \
-ldflags="-X 'github.com/mesg-foundation/core/version.Version=$1'" \
-out mesg-core \
-dest ./bin \
./interface/cli
sudo chmod +x ./bin/*
mkdir -p bin

archs=(amd64 386)
oss=(linux darwin)

for os in ${oss[*]}; do
for arch in ${archs[*]}; do
echo "Building $os $arch..."
GOOS=$os GOARCH=$arch go build \
-o ./bin/mesg-core-$os-$arch \
-ldflags="-X 'github.com/mesg-foundation/core/version.Version=$1'" \
./interface/cli
done
done