From 162528bdeb3adc3ccda95715c4321c99ce3a6ca6 Mon Sep 17 00:00:00 2001 From: Josh Baker Date: Tue, 8 Mar 2016 06:12:39 -0700 Subject: [PATCH] fixed ldflags --- build.sh | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/build.sh b/build.sh index 2b36291d..4902853f 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,15 @@ set -e VERSION="0.0.1" -PROTECTED_MODE="no" +PROTECTED_MODE="no" + +# Hardcode some values to the core package +LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}" +LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=$(git rev-parse --short HEAD)" +LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)" +if [ "$PROTECTED_MODE" == "no" ]; then + LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no" +fi export GO15VENDOREXPERIMENT=1 @@ -32,13 +40,6 @@ fi core/gen.sh -LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.Version=${VERSION}" -LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.GitSHA=$(git rev-parse --short HEAD)" -LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.BuildTime=$(date +%FT%T%z)" -if [ "$PROTECTED_MODE" == "no" ]; then - LDFLAGS="$LDFLAGS -X github.com/tidwall/tile38/core.ProtectedMode=no" -fi - # build and store objects into original directory. go build -ldflags "$LDFLAGS" -o "$OD/tile38-server" cmd/tile38-server/*.go go build -ldflags "$LDFLAGS" -o "$OD/tile38-cli" cmd/tile38-cli/*.go