From d6e38ddf8a11a0ccd0708a33ef81e058626b325f Mon Sep 17 00:00:00 2001 From: Guillaume Date: Thu, 8 Feb 2018 18:09:39 -0500 Subject: [PATCH] Minor tweaks to Windows build scripts (#3931) --- make.bat | 10 ++++++++-- scripts/windows/build.bat | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/make.bat b/make.bat index 34adbfded9..c5b6baf0f6 100644 --- a/make.bat +++ b/make.bat @@ -6,7 +6,8 @@ set _EXITCODE=0 REM If no target is provided, default to test. if [%1]==[] goto test -set _TARGETS=bin,dev,generate,test,testacc,testrace,vet +set _TARGETS=bin,bootstrap,dev,generate,test,testacc,testrace,vet +set _EXTERNAL_TOOLS=github.com/mitchellh/gox,github.com/kardianos/govendor REM Run target. for %%a in (%_TARGETS%) do (if x%1==x%%a goto %%a) @@ -18,6 +19,11 @@ REM bin generates the releaseable binaries for Vault call .\scripts\windows\build.bat "%CD%" goto :eof +REM bootstrap downloads required build tools +:bootstrap + for %%t in (%_EXTERNAL_TOOLS%) do (go get -u -v %%t) + goto :eof + REM dev creates binaries for testing Vault locally. These are put REM into ./bin/ as well as %GOPATH%/bin :dev @@ -28,7 +34,7 @@ REM into ./bin/ as well as %GOPATH%/bin REM generate runs `go generate` to build the dynamically generated REM source files. :generate - go list ./... | findstr /v vendor | go generate + for /F "usebackq" %%f in (`go list ./... ^| findstr /v vendor`) do @go generate %%f goto :eof REM test runs the unit tests and vets the code. diff --git a/scripts/windows/build.bat b/scripts/windows/build.bat index feace8f29b..0e33e4c673 100644 --- a/scripts/windows/build.bat +++ b/scripts/windows/build.bat @@ -60,7 +60,7 @@ echo ==^> Building... gox^ -os="%_XC_OS%"^ -arch="%_XC_ARCH%"^ - -ldflags "-X github.com/hashicorp/vault/version.GitCommit %_GIT_COMMIT%%_GIT_DIRTY%"^ + -ldflags "-X github.com/hashicorp/vault/version.GitCommit=%_GIT_COMMIT%%_GIT_DIRTY%"^ -output "pkg/{{.OS}}_{{.Arch}}/vault"^ .