forked from etcd-io/etcd
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vendor: only vendor on emitted binaries
Moves the vendor/ directory to cmd/vendor. Vendored binaries are built from cmd/, which is backed by symlinks pointing back to repo root.
- Loading branch information
Anthony Romano
committed
Apr 6, 2016
1 parent
b9e933b
commit b1d4101
Showing
635 changed files
with
68 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1 @@ | ||
@echo off | ||
|
||
SET ORG_PATH=github.com\coreos | ||
SET REPO_PATH=%ORG_PATH%\etcd | ||
|
||
SET GOPATH=%cd%\gopath | ||
|
||
:: Cleanup old builds | ||
IF EXIST "%GOPATH%\src\%REPO_PATH%" rmdir /s /q "%GOPATH%\src\%REPO_PATH%" | ||
IF EXIST "%GOPATH%\src\%ORG_PATH%" rmdir /s /q "%GOPATH%\src\%ORG_PATH%" | ||
IF EXIST "%cd%\bin" rmdir /s /q "%cd%\bin" | ||
|
||
md "%GOPATH%\src\%ORG_PATH%" | ||
|
||
mklink /d "%GOPATH%\src\%REPO_PATH%" "%cd%" | ||
FOR /f "usebackq tokens=*" %%a IN (`go env`) DO %%a | ||
|
||
(FOR /f "tokens=*" %%i IN ('git rev-parse --short HEAD') DO SET GIT_SHA=%%i) 2>NUL | ||
IF NOT DEFINED GIT_SHA SET GIT_SHA=GitNotFound | ||
|
||
:: Static compilation is useful when etcd is run in a container | ||
SET CGO_ENABLED=0 | ||
go build -a -installsuffix cgo -ldflags "-s -X %REPO_PATH%\version.GitSHA %GIT_SHA%" -o bin\etcd.exe "%REPO_PATH%" | ||
:: TODO: Get the %GIT_SHA% argument to work. Useful for `etcd --version` style commands. | ||
go build -a -installsuffix cgo -ldflags "-s" -o bin\etcdctl.exe "%REPO_PATH%\etcdctl" | ||
powershell -ExecutionPolicy Bypass -File build.ps1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
$ORG_PATH="github.com/coreos" | ||
$REPO_PATH="$ORG_PATH/etcd" | ||
$PWD = $((Get-Item -Path ".\" -Verbose).FullName) | ||
|
||
# rebuild symlinks | ||
echo "Rebuilding symlinks" | ||
git ls-files -s cmd | select-string -pattern 120000 | ForEach { | ||
$l = $_.ToString() | ||
$lnkname = $l.Split(' ')[1] | ||
$target = "$(git log -p HEAD -- $lnkname | select -last 2 | select -first 1)" | ||
$target = $target.SubString(1,$target.Length-1).Replace("/","\") | ||
$lnkname = $lnkname.Replace("/","\") | ||
|
||
$terms = $lnkname.Split("\") | ||
$dirname = $terms[0..($terms.length-2)] -join "\" | ||
|
||
$lnkname = "$PWD\$lnkname" | ||
$targetAbs = "$((Get-Item -Path "$dirname\$target").FullName)" | ||
$targetAbs = $targetAbs.Replace("/", "\") | ||
if (test-path -pathtype container "$targetAbs") { | ||
# rd so deleting junction doesn't take files with it | ||
cmd /c rd "$lnkname" | ||
cmd /c del /A /F "$lnkname" | ||
cmd /c mklink /J "$lnkname" "$targetAbs" | ||
} else { | ||
cmd /c del /A /F "$lnkname" | ||
cmd /c mklink /H "$lnkname" "$targetAbs" | ||
} | ||
} | ||
|
||
if (-not $env:GOPATH) { | ||
$orgpath="$PWD\gopath\src\" + $ORG_PATH.Replace("/", "\") | ||
cmd /c rd "$orgpath\etcd" | ||
cmd /c del "$orgpath" | ||
cmd /c mkdir "$orgpath" | ||
cmd /c mklink /J "$orgpath\etcd" "$PWD" | ||
$env:GOPATH = "$PWD\gopath" | ||
} | ||
|
||
# Static compilation is useful when etcd is run in a container | ||
$env:CGO_ENABLED = 0 | ||
$env:GO15VENDOREXPERIMENT = 1 | ||
# TODO: Get the GIT_SHA argument to work for `etcd --version` style commands. | ||
$GIT_SHA="$(git rev-parse --short HEAD)" | ||
go build -a -installsuffix cgo -ldflags "-s -X $REPO_PATH/version.GitSHA=$GIT_SHA" -o bin\etcd.exe "$REPO_PATH\cmd" | ||
go build -a -installsuffix cgo -ldflags "-s" -o bin\etcdctl.exe "$REPO_PATH\cmd\etcdctl" |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## cmd | ||
|
||
This directory is meant to enforce vendoring for etcd binaries without polluting | ||
the etcd client libraries with vendored dependencies. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../etcdctl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../etcdmain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../main.go |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../tools |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.