mirror of
https://github.com/microsoft/vcpkg.git
synced 2024-12-27 18:31:15 +08:00
Make bootstrap.bat parameters match bootstrap.sh
This commit is contained in:
parent
f2a8b4f1fb
commit
56cc9ac15c
@ -10,7 +10,7 @@ We do collect telemetry data from usage of "vcpkg.exe". We explicitly ONLY colle
|
|||||||
We collect the command line used, the time of invocation, and how long execution took. Some commands also add additional calculated information (such as the full set of libraries to install). We generate a completely random UUID on first use and attach it to each event.
|
We collect the command line used, the time of invocation, and how long execution took. Some commands also add additional calculated information (such as the full set of libraries to install). We generate a completely random UUID on first use and attach it to each event.
|
||||||
In order to opt-out of data collection, you can re-run the boostrap script with the following flag, for Windows and Linux/OSX, respectively:
|
In order to opt-out of data collection, you can re-run the boostrap script with the following flag, for Windows and Linux/OSX, respectively:
|
||||||
|
|
||||||
```PS> .\bootstrap-vcpkg.bat -disableMetrics 1```
|
```PS> .\bootstrap-vcpkg.bat -disableMetrics```
|
||||||
|
|
||||||
```~/$ ./bootstrap-vcpkg.sh -disableMetrics```
|
```~/$ ./bootstrap-vcpkg.sh -disableMetrics```
|
||||||
|
|
||||||
|
@ -1,10 +1,24 @@
|
|||||||
[CmdletBinding()]
|
[CmdletBinding()]
|
||||||
param(
|
param(
|
||||||
[ValidateNotNullOrEmpty()][string]$disableMetrics = "0",
|
$badParam,
|
||||||
|
[Parameter(Mandatory=$False)][switch]$disableMetrics = $false,
|
||||||
[Parameter(Mandatory=$False)][string]$withVSPath = "",
|
[Parameter(Mandatory=$False)][string]$withVSPath = "",
|
||||||
[Parameter(Mandatory=$False)][string]$withWinSDK = ""
|
[Parameter(Mandatory=$False)][string]$withWinSDK = ""
|
||||||
)
|
)
|
||||||
Set-StrictMode -Version Latest
|
Set-StrictMode -Version Latest
|
||||||
|
# Powershell2-compatible way of forcing named-parameters
|
||||||
|
if ($badParam)
|
||||||
|
{
|
||||||
|
if ($disableMetrics -and $badParam -eq "1")
|
||||||
|
{
|
||||||
|
Write-Warning "'disableMetrics 1' is deprecated, please change to 'disableMetrics' (without '1')"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw "Only named parameters are allowed"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
|
$scriptsDir = split-path -parent $script:MyInvocation.MyCommand.Definition
|
||||||
$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash
|
$withVSPath = $withVSPath -replace "\\$" # Remove potential trailing backslash
|
||||||
|
|
||||||
@ -306,9 +320,15 @@ $msbuildExe = $msbuildExeWithPlatformToolset[0]
|
|||||||
$platformToolset = $msbuildExeWithPlatformToolset[1]
|
$platformToolset = $msbuildExeWithPlatformToolset[1]
|
||||||
$windowsSDK = getWindowsSDK -withWinSDK $withWinSDK
|
$windowsSDK = getWindowsSDK -withWinSDK $withWinSDK
|
||||||
|
|
||||||
|
$disableMetricsValue = "0"
|
||||||
|
if ($disableMetrics)
|
||||||
|
{
|
||||||
|
$disableMetricsValue = "1"
|
||||||
|
}
|
||||||
|
|
||||||
$arguments = (
|
$arguments = (
|
||||||
"`"/p:VCPKG_VERSION=-nohash`"",
|
"`"/p:VCPKG_VERSION=-nohash`"",
|
||||||
"`"/p:DISABLE_METRICS=$disableMetrics`"",
|
"`"/p:DISABLE_METRICS=$disableMetricsValue`"",
|
||||||
"/p:Configuration=release",
|
"/p:Configuration=release",
|
||||||
"/p:Platform=x86",
|
"/p:Platform=x86",
|
||||||
"/p:PlatformToolset=$platformToolset",
|
"/p:PlatformToolset=$platformToolset",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user