add equivalent Powershell scripts to ./build so that etcd can be built on Windows

This commit is contained in:
AndyPook 2013-09-17 09:15:23 +01:00
parent 09f31af88a
commit f03481f733
2 changed files with 31 additions and 0 deletions

24
build.ps1 Normal file
View File

@ -0,0 +1,24 @@
$ETCD_PACKAGE="github.com/coreos/etcd"
$env:GOPATH=$pwd.Path
$SRC_DIR="$env:GOPATH/src"
$ETCD_DIR="$SRC_DIR/$ETCD_PACKAGE"
$env:ETCD_DIR="$SRC_DIR/$ETCD_PACKAGE"
$ETCD_BASE=(Split-Path $ETCD_DIR -Parent)
if(-not(test-path $ETCD_DIR)){
mkdir -force "$ETCD_BASE" > $null
}
if(-not(test-path $ETCD_DIR )){
cmd /c 'mklink /D "%ETCD_DIR%" ..\..\..\'
}
foreach($i in (ls third_party/*)){
if("$i" -eq "third_party/src") {continue}
cp -Recurse -force "$i" src/
}
./scripts/release-version.ps1 | Out-File -Encoding UTF8 release_version.go
go build -v "${ETCD_PACKAGE}"

View File

@ -0,0 +1,7 @@
$VER=(git describe --tags HEAD)
@"
package main
const releaseVersion = "$VER"
"@