From 9e2f6e59e1591274a24acd86df445d2df99988b5 Mon Sep 17 00:00:00 2001 From: Nishchay Date: Thu, 16 Oct 2014 09:48:47 -0700 Subject: [PATCH 1/4] Create build.bat --- build.bat | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 build.bat diff --git a/build.bat b/build.bat new file mode 100644 index 000000000..146b73b2f --- /dev/null +++ b/build.bat @@ -0,0 +1,14 @@ +@echo off + +set GOARCH=%1 +IF "%1" == "" (set GOARCH=amd64) +set ORG_PATH=github.com\hashicorp +set REPO_PATH=%ORG_PATH%\consul + +set GOPATH=%cd%\gopath + +rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul +mkdir %GOPATH%\src\%ORG_PATH% 2>nul +mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul + +%GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH% From ea0cc35747da14a8752dde50bc81706b8f840221 Mon Sep 17 00:00:00 2001 From: awesomenix Date: Sat, 13 Dec 2014 10:46:43 -0800 Subject: [PATCH 2/4] Add Instructions on Downloading Mingw 64bit for Building memdb --- build.bat | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/build.bat b/build.bat index 146b73b2f..144dff76d 100644 --- a/build.bat +++ b/build.bat @@ -1,5 +1,7 @@ @echo off +REM Download Mingw 64 on Windows from http://win-builds.org/download.html + set GOARCH=%1 IF "%1" == "" (set GOARCH=amd64) set ORG_PATH=github.com\hashicorp @@ -9,6 +11,7 @@ set GOPATH=%cd%\gopath rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul mkdir %GOPATH%\src\%ORG_PATH% 2>nul +go get .\... mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul -%GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH% +%GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH% \ No newline at end of file From 9561634823f339fe019cf0f3452c67560e5ec3a3 Mon Sep 17 00:00:00 2001 From: awesomenix Date: Sat, 13 Dec 2014 11:58:54 -0800 Subject: [PATCH 3/4] Add missing switch -u, which updates packages --- build.bat | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.bat b/build.bat index 144dff76d..fed2085c8 100644 --- a/build.bat +++ b/build.bat @@ -11,7 +11,7 @@ set GOPATH=%cd%\gopath rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul mkdir %GOPATH%\src\%ORG_PATH% 2>nul -go get .\... +go get -u .\... mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul %GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH% \ No newline at end of file From c496f4e04f24f8c93ed54e7615ff1aa04bd091db Mon Sep 17 00:00:00 2001 From: awesomenix Date: Sat, 13 Dec 2014 12:11:41 -0800 Subject: [PATCH 4/4] Make modulename param so build.bat can be generalized and used for any go project --- build.bat | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/build.bat b/build.bat index fed2085c8..f52277533 100644 --- a/build.bat +++ b/build.bat @@ -2,16 +2,17 @@ REM Download Mingw 64 on Windows from http://win-builds.org/download.html -set GOARCH=%1 -IF "%1" == "" (set GOARCH=amd64) +set GOARCH=%2 +IF "%2" == "" (set GOARCH=amd64) +set MODULENAME=%1 set ORG_PATH=github.com\hashicorp -set REPO_PATH=%ORG_PATH%\consul +set REPO_PATH=%ORG_PATH%\%MODULENAME% set GOPATH=%cd%\gopath rmdir /s /q %GOPATH%\src\%REPO_PATH% 2>nul mkdir %GOPATH%\src\%ORG_PATH% 2>nul -go get -u .\... +go get .\... mklink /J "%GOPATH%\src\%REPO_PATH%" "%cd%" 2>nul -%GOROOT%\bin\go build -o bin\%GOARCH%\consul.exe %REPO_PATH% \ No newline at end of file +%GOROOT%\bin\go build -o bin\%GOARCH%\%MODULENAME%.exe %REPO_PATH% \ No newline at end of file