From f03481f7335868c8780c1be939f3807a67cdceeb Mon Sep 17 00:00:00 2001 From: AndyPook Date: Tue, 17 Sep 2013 09:15:23 +0100 Subject: [PATCH] add equivalent Powershell scripts to ./build so that etcd can be built on Windows --- build.ps1 | 24 ++++++++++++++++++++++++ scripts/release-version.ps1 | 7 +++++++ 2 files changed, 31 insertions(+) create mode 100644 build.ps1 create mode 100644 scripts/release-version.ps1 diff --git a/build.ps1 b/build.ps1 new file mode 100644 index 000000000..c75f608d7 --- /dev/null +++ b/build.ps1 @@ -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}" diff --git a/scripts/release-version.ps1 b/scripts/release-version.ps1 new file mode 100644 index 000000000..544028440 --- /dev/null +++ b/scripts/release-version.ps1 @@ -0,0 +1,7 @@ + +$VER=(git describe --tags HEAD) + +@" +package main +const releaseVersion = "$VER" +"@ \ No newline at end of file