4
0
mirror of https://github.com/cwinfo/yggdrasil-go.git synced 2025-06-14 19:46:05 +00:00

Imprint build name and version number if available

This commit is contained in:
Neil Alexander
2018-12-07 22:20:11 +00:00
parent 4bc009d845
commit 8e784438c7
3 changed files with 29 additions and 2 deletions

5
build
View File

@ -14,10 +14,11 @@ go get -d -v yggdrasil
for file in *.go ; do
echo "Building: $file"
#go build $@ $file
IMPRINT="-X yggdrasil.buildName=$(sh contrib/semver/name.sh) -X yggdrasil.buildVersion=$(sh contrib/semver/version.sh)"
if [ $DEBUG ]; then
go build -tags debug -v $file
go build -ldflags="$IMPRINT" -tags debug -v $file
else
go build -ldflags="-s -w" -v $file
go build -ldflags="$IMPRINT -s -w" -v $file
fi
if [ $UPX ]; then
upx --brute ${file%.go}