mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
add equivalent Powershell scripts to ./build so that etcd can be built on Windows
This commit is contained in:
parent
09f31af88a
commit
f03481f733
24
build.ps1
Normal file
24
build.ps1
Normal 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}"
|
7
scripts/release-version.ps1
Normal file
7
scripts/release-version.ps1
Normal file
@ -0,0 +1,7 @@
|
||||
|
||||
$VER=(git describe --tags HEAD)
|
||||
|
||||
@"
|
||||
package main
|
||||
const releaseVersion = "$VER"
|
||||
"@
|
Loading…
x
Reference in New Issue
Block a user