aboutsummaryrefslogtreecommitdiff
path: root/scripts/bootstrap.ps1
diff options
context:
space:
mode:
authorAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:50:08 -0700
committerAlexander Karatarakis <alkarata@microsoft.com>2016-09-18 20:54:03 -0700
commitccca198c1b1730b0241911cb56dc8e3504958b2a (patch)
treea2dd9b8b087a09afdcecc5cbb3377bed15127eb2 /scripts/bootstrap.ps1
downloadvcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.tar.gz
vcpkg-ccca198c1b1730b0241911cb56dc8e3504958b2a.zip
Initial commit
Diffstat (limited to 'scripts/bootstrap.ps1')
-rw-r--r--scripts/bootstrap.ps131
1 files changed, 31 insertions, 0 deletions
diff --git a/scripts/bootstrap.ps1 b/scripts/bootstrap.ps1
new file mode 100644
index 000000000..568f56995
--- /dev/null
+++ b/scripts/bootstrap.ps1
@@ -0,0 +1,31 @@
+[CmdletBinding()]
+param(
+ [ValidateNotNullOrEmpty()]
+ [string]$disableMetrics = "0"
+)
+
+$vcpkgRoot = (get-item $PSScriptRoot).parent.FullName
+
+$gitHash = git rev-parse HEAD
+Write-Verbose("Git hash is " + $gitHash)
+$gitStartOfHash = $gitHash.substring(0,6)
+$vcpkgSourcesPath = "$vcpkgRoot\toolsrc"
+Write-Verbose("vcpkg Path " + $vcpkgSourcesPath)
+
+if (!(Test-Path $vcpkgSourcesPath))
+{
+ New-Item -ItemType directory -Path $vcpkgSourcesPath -force | Out-Null
+}
+
+try{
+ pushd $vcpkgSourcesPath
+ cmd /c "$env:VS140COMNTOOLS..\..\VC\vcvarsall.bat" x86 "&" msbuild "/p:VCPKG_VERSION=-$gitHash" "/p:DISABLE_METRICS=$disableMetrics" /p:Configuration=Release /p:Platform=x86 /m
+
+ Write-Verbose("Placing vcpkg.exe in the correct location")
+
+ Copy-Item $vcpkgSourcesPath\Release\vcpkg.exe $vcpkgRoot\vcpkg.exe | Out-Null
+ Copy-Item $vcpkgSourcesPath\Release\vcpkgmetricsuploader.exe $vcpkgRoot\scripts\vcpkgmetricsuploader.exe | Out-Null
+}
+finally{
+ popd
+}