Minor tweaks to Windows build scripts (#3931)

This commit is contained in:
Guillaume
2018-02-08 18:09:39 -05:00
committed by Jeff Mitchell
parent dd9f17ef7d
commit d6e38ddf8a
2 changed files with 9 additions and 3 deletions

View File

@@ -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.

View File

@@ -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"^
.