-
Notifications
You must be signed in to change notification settings - Fork 266
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve user experience of restoring/building/testing (#2261)
Add open-vs.cmd, restore.sh and restore.cmd. Fix build.cmd, test.cmd and test.sh. We will now always try to install the Windows 10 SDK except if the -skipInstallWindowsSdk switch is provided. This should reduce the number of issues linked to this SDK being missing. Provides a script to allow opening the solution ensuring that the local SDK is used. It won't prevent users to see issue if they open the sln directly but this should reduce friction, especially after the contributing readme is up to date.
- Loading branch information
1 parent
2a1ef22
commit 19b77bf
Showing
10 changed files
with
111 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@echo off | ||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*" | ||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -installWindowsSdk -restore -build %*" | ||
exit /b %ErrorLevel% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
@echo off | ||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -test -integrationTest %*" | ||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -test -integrationTest %*" | ||
exit /b %ErrorLevel% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
[CmdletBinding(PositionalBinding=$false)] | ||
Param( | ||
[string][Alias('c')]$configuration = "Debug", | ||
[string]$platform = $null, | ||
[string] $projects, | ||
[string][Alias('v')]$verbosity = "minimal", | ||
[string] $msbuildEngine = $null, | ||
[bool] $warnAsError = $true, | ||
[bool] $nodeReuse = $true, | ||
[switch][Alias('r')]$restore, | ||
[switch] $deployDeps, | ||
[switch][Alias('b')]$build, | ||
[switch] $rebuild, | ||
[switch] $deploy, | ||
[switch][Alias('t')]$test, | ||
[switch] $integrationTest, | ||
[switch] $performanceTest, | ||
[switch] $sign, | ||
[switch] $pack, | ||
[switch] $publish, | ||
[switch] $clean, | ||
[switch][Alias('bl')]$binaryLog, | ||
[switch][Alias('nobl')]$excludeCIBinarylog, | ||
[switch] $ci, | ||
[switch] $prepareMachine, | ||
[string] $runtimeSourceFeed = '', | ||
[string] $runtimeSourceFeedKey = '', | ||
[switch] $excludePrereleaseVS, | ||
[switch] $nativeToolsOnMachine, | ||
[switch] $help, | ||
[switch] $vs, | ||
[switch] $installWindowsSdk, | ||
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties | ||
) | ||
|
||
if ($vs) { | ||
. $PSScriptRoot\common\tools.ps1 | ||
|
||
# This tells .NET Core to use the bootstrapped runtime | ||
$env:DOTNET_ROOT=InitializeDotNetCli -install:$true -createSdkLocationFile:$true | ||
|
||
# This tells MSBuild to load the SDK from the directory of the bootstrapped SDK | ||
$env:DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR=$env:DOTNET_ROOT | ||
|
||
# This tells .NET Core not to go looking for .NET Core in other places | ||
$env:DOTNET_MULTILEVEL_LOOKUP=0; | ||
|
||
# Put our local dotnet.exe on PATH first so Visual Studio knows which one to use | ||
$env:PATH=($env:DOTNET_ROOT + ";" + $env:PATH); | ||
|
||
# Disable .NET runtime signature validation errors which errors for local builds | ||
$env:VSDebugger_ValidateDotnetDebugLibSignatures=0; | ||
|
||
# Launch Visual Studio with the locally defined environment variables | ||
& "$PSScriptRoot\..\TestFx.sln" | ||
|
||
return | ||
} | ||
|
||
if ($installWindowsSdk) { | ||
& $PSScriptRoot\install-windows-sdk.ps1 | ||
} else { | ||
Write-Host "Skipping Windows SDK installation" | ||
} | ||
|
||
# Remove extra parameters that are not used by the common build script | ||
$null = $PSBoundParameters.Remove("vs") | ||
$null = $PSBoundParameters.Remove("installWindowsSdk") | ||
|
||
& $PSScriptRoot\common\Build.ps1 @PSBoundParameters |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if (Test-Path "${env:ProgramFiles(x86)}\Windows Kits\10\UnionMetadata\10.0.16299.0") { | ||
Write-Host "Windows SDK 10.0.16299 is already installed, skipping..." | ||
} else { | ||
Write-Host "Downloading Windows SDK 10.0.16299..." | ||
Invoke-WebRequest -Method Get -Uri https://go.microsoft.com/fwlink/p/?linkid=864422 -OutFile sdksetup.exe -UseBasicParsing | ||
|
||
Write-Host "Installing Windows SDK, if setup requests elevation please approve." -ForegroundColor Green | ||
$process = Start-Process -Wait sdksetup.exe -ArgumentList "/quiet", "/norestart", "/ceip off", "/features OptionId.UWPManaged" -PassThru | ||
|
||
if ($process.ExitCode -eq 0) { | ||
Remove-Item sdksetup.exe -Force | ||
Write-Host "Installation succeeded" | ||
} | ||
else { | ||
Write-Error "Failed to install Windows SDK (Exit code: $($process.ExitCode))" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\build.ps1""" -vs %*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
@echo off | ||
powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\Build.ps1""" -installWindowsSdk -restore %*" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
source="${BASH_SOURCE[0]}" | ||
|
||
# resolve $SOURCE until the file is no longer a symlink | ||
while [[ -h $source ]]; do | ||
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" | ||
source="$(readlink "$source")" | ||
|
||
# if $source was a relative symlink, we need to resolve it relative to the path where the | ||
# symlink file was located | ||
[[ $source != /* ]] && source="$scriptroot/$source" | ||
done | ||
|
||
scriptroot="$( cd -P "$( dirname "$source" )" && pwd )" | ||
"$scriptroot/eng/common/build.sh" --restore $@ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters