Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .gitattributes
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#
# Merging from the command prompt will add diff markers to the files if there
# are conflicts (Merging from VS is not affected by the settings below, in VS
# the diff markers are never inserted). Diff markers may cause the following
# the diff markers are never inserted). Diff markers may cause the following
# file extensions to fail to load in VS. An alternative would be to treat
# these files as binary and thus will always conflict and require user
# intervention with every merge. To do so, just uncomment the entries below
Expand Down Expand Up @@ -46,9 +46,9 @@

###############################################################################
# diff behavior for common document formats
#
#
# Convert binary document formats to text before diffing them. This feature
# is only available from the command line. Turn it on by uncommenting the
# is only available from the command line. Turn it on by uncommenting the
# entries below.
###############################################################################
#*.doc diff=astextplain
Expand Down
2 changes: 1 addition & 1 deletion .runsettings
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<RunSettings>
<MSTest>
<MaxCpuCount>0</MaxCpuCount>
<MaxCpuCount>0</MaxCpuCount>
<Parallelize>
<Workers>0</Workers>
<Scope>ClassLevel</Scope>
Expand Down
22 changes: 11 additions & 11 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ pr:
pool:
vmImage: windows-2019

variables:
variables:
BuildConfiguration: Release

jobs:
### BUILD ###
- job: BuildBits
timeoutInMinutes: 60

steps:
- task: BatchScript@1
inputs:
Expand All @@ -32,7 +32,7 @@ jobs:
inputs:
versionSpec: 5.6.0

- task: DotNetCoreCLI@2
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
Expand All @@ -45,12 +45,12 @@ jobs:
#- powershell: .\build\Install-WindowsSdkISO.ps1 19041
# displayName: Insider SDK

- powershell: .\build\build.ps1 -target=Build
- powershell: .\build\build.ps1 -Target Build
displayName: Build

### Unit Tests ###
- powershell: .\build\build.ps1 -target=Test

- powershell: .\build\build.ps1 -Target Test
displayName: Test

- task: PublishTestResults@2
Expand All @@ -62,7 +62,7 @@ jobs:

### UI Integration Tests ###

- powershell: .\build\build.ps1 -target=UITest
- powershell: .\build\build.ps1 -Target UITest
displayName: UI Integration Tests

- task: PublishPipelineArtifact@1
Expand All @@ -81,7 +81,7 @@ jobs:

### Package ###

- powershell: .\build\build.ps1 -target=Package
- powershell: .\build\build.ps1 -Target Package
displayName: Package

- task: PowerShell@2
Expand All @@ -105,15 +105,15 @@ jobs:
- job: SmokeTests
dependsOn: BuildBits
timeoutInMinutes: 60

steps:
- task: DownloadPipelineArtifact@2
displayName: Download NuGet Packages Artifact
inputs:
artifact: Packages
path: .\bin\nupkg

- task: DotNetCoreCLI@2
- task: DotNetCoreCLI@2
inputs:
command: custom
custom: tool
Expand All @@ -123,7 +123,7 @@ jobs:
- script: nbgv cloud
displayName: Set Version

- powershell: .\build\build.ps1 -target=SmokeTest
- powershell: .\build\build.ps1 -Target SmokeTest
displayName: SmokeTest

- task: CopyFiles@2
Expand Down
70 changes: 29 additions & 41 deletions build/Find-WindowsSDKVersions.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,16 @@ $ErrorActionPreference = 'Stop'
# Unique set of Windows SDK versions referenced in files
$versions = New-Object System.Collections.Generic.HashSet[System.String]

function Get-Nodes
{
function Get-Nodes {
param(
[parameter(ValueFromPipeline=$true)]
[xml] $xml,
[parameter(Mandatory=$true)]
[parameter(ValueFromPipeline = $true)]
[xml] $xml,
[parameter(Mandatory = $true)]
[string] $nodeName)

# Try the old style csproj. Also format required for .targets and .props files
$n = Select-Xml -Xml $xml.Project -Namespace @{d = $ns } -XPath "//d:$nodeName"

# Try the SDK-style files
if (!$n) {
$r = Select-Xml -Xml $xml.Project -XPath "//$nodeName"
Expand All @@ -24,11 +23,10 @@ function Get-Nodes
return $r
}

function Get-NodeValue
{
function Get-NodeValue {
param(
[parameter(ValueFromPipeline=$true)]
[xml] $xml,
[parameter(ValueFromPipeline = $true)]
[xml] $xml,
[string] $nodeName)

$node = get-nodes $xml $nodeName
Expand All @@ -42,10 +40,9 @@ function Get-NodeValue
return [string]""
}

function Get-SdkVersion
{
function Get-SdkVersion {
param(
[Parameter(ValueFromPipeline=$true)] $file)
[Parameter(ValueFromPipeline = $true)] $file)

[xml] $xml = Get-Content $file

Expand All @@ -67,26 +64,22 @@ function Get-SdkVersion
$versions.Add("10.0." + $version + ".0") | Out-Null
}

function Test-RegistryPathAndValue
{
function Test-RegistryPathAndValue {
param (
[parameter(Mandatory=$true)]
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $path,
[parameter(Mandatory=$true)]
[parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string] $value)

try
{
if (Test-Path $path)
{
try {
if (Test-Path $path) {
Get-ItemProperty -Path $path | Select-Object -ExpandProperty $value -ErrorAction Stop | Out-Null
return $true
}
}
catch
{
catch {
}

return $false
Expand All @@ -101,24 +94,18 @@ function Test-InstallWindowsSdk([string] $WindowsSDKVersion) {

$WindowsSDKInstalledRegPath = "$WindowsSDKRegPath\$WindowsSDKVersion\Installed Options"

if (Test-RegistryPathAndValue -Path $WindowsSDKRegPath -Value $WindowsSDKRegRootKey)
{
if (Test-RegistryPathAndValue -Path $WindowsSDKRegPath -Value $WindowsSDKRegRootKey) {
# A Windows SDK is installed
# Is an SDK of our version installed with the options we need?
if (Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value "$WindowsSDKOptions")
{
if (Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value "$WindowsSDKOptions") {
# It appears we have what we need. Double check the disk
$sdkRoot = Get-ItemProperty -Path $WindowsSDKRegPath | Select-Object -ExpandProperty $WindowsSDKRegRootKey
if ($sdkRoot)
{
if (Test-Path $sdkRoot)
{
if ($sdkRoot) {
if (Test-Path $sdkRoot) {
$refPath = Join-Path $sdkRoot "References\$WindowsSDKVersion"
if (Test-Path $refPath)
{
if (Test-Path $refPath) {
$umdPath = Join-Path $sdkRoot "UnionMetadata\$WindowsSDKVersion"
if (Test-Path $umdPath)
{
if (Test-Path $umdPath) {
# Pretty sure we have what we need
$retval = $false
}
Expand All @@ -131,13 +118,13 @@ function Test-InstallWindowsSdk([string] $WindowsSDKVersion) {
return $retval
}

if(!$PSScriptRoot){
if (!$PSScriptRoot) {
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}

Write-Host -NoNewline "Locating referenced Windows SDK versions..."

Get-ChildItem *.csproj -Recurse | ForEach-Object { get-sdkversion $_}
Get-ChildItem *.csproj -Recurse | ForEach-Object { get-sdkversion $_ }
Get-ChildItem *.targets -Recurse | ForEach-Object { get-sdkversion $_ }
Get-ChildItem *.props -Recurse | ForEach-Object { get-sdkversion $_ }

Expand All @@ -146,20 +133,21 @@ Write-Host

$anyInstallRequired = $false;

foreach($version in $versions) {
foreach ($version in $versions) {
if ($version -match "10\.0\.\d{5}\.0") {
$installRequired = Test-InstallWindowsSDK $version
Write-Host "Windows SDK '$version' install required: $installRequired"
if ($installRequired) {
if ($installRequired) {
# Automatically invoke Install-WindowsSDKIso.ps1 ?
$anyInstallRequired = $true
}
}
}

Write-Host
if ($anyInstallRequired) {
if ($anyInstallRequired) {
throw "At least one Windows SDK is missing from this machine"
} else {
}
else {
Write-Host "All referenced Windows SDKs are installed!"
}
12 changes: 8 additions & 4 deletions build/Install-WindowsSDK.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
mkdir c:\winsdktemp

$client = new-object System.Net.WebClient
$client.DownloadFile("https://go.microsoft.com/fwlink/p/?linkid=870807","c:\winsdktemp\winsdksetup.exe")
$WinSdkTempDir = "C:\WinSdkTemp\"
$WinSdkSetupExe = "C:\WinSdkTemp\" + "WinSdkSetup.exe"

Start-Process -Wait "c:\winsdktemp\winsdksetup.exe" "/features OptionId.UWPCpp /q"
mkdir $WinSdkTempDir

$client = [System.Net.WebClient]::new()
$client.DownloadFile("https://go.microsoft.com/fwlink/p/?linkid=870807", $WinSdkSetupExe)

Start-Process -Wait $WinSdkSetupExe "/features OptionId.UWPCpp /q"
Loading