Skip to content

Commit 9326ea2

Browse files
Merge pull request #4072 from Nirmal4G/hotfix/upgrade-build
Upgrade Cake Build and its dependencies
2 parents f7d00c7 + 2444b55 commit 9326ea2

16 files changed

+280
-279
lines changed

.gitattributes

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#
1818
# Merging from the command prompt will add diff markers to the files if there
1919
# are conflicts (Merging from VS is not affected by the settings below, in VS
20-
# the diff markers are never inserted). Diff markers may cause the following
20+
# the diff markers are never inserted). Diff markers may cause the following
2121
# file extensions to fail to load in VS. An alternative would be to treat
2222
# these files as binary and thus will always conflict and require user
2323
# intervention with every merge. To do so, just uncomment the entries below
@@ -46,9 +46,9 @@
4646

4747
###############################################################################
4848
# diff behavior for common document formats
49-
#
49+
#
5050
# Convert binary document formats to text before diffing them. This feature
51-
# is only available from the command line. Turn it on by uncommenting the
51+
# is only available from the command line. Turn it on by uncommenting the
5252
# entries below.
5353
###############################################################################
5454
#*.doc diff=astextplain

.runsettings

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<RunSettings>
22
<MSTest>
3-
<MaxCpuCount>0</MaxCpuCount>
3+
<MaxCpuCount>0</MaxCpuCount>
44
<Parallelize>
55
<Workers>0</Workers>
66
<Scope>ClassLevel</Scope>

azure-pipelines.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,14 @@ pr:
1111
pool:
1212
vmImage: windows-2019
1313

14-
variables:
14+
variables:
1515
BuildConfiguration: Release
1616

1717
jobs:
1818
### BUILD ###
1919
- job: BuildBits
2020
timeoutInMinutes: 60
21-
21+
2222
steps:
2323
- task: BatchScript@1
2424
inputs:
@@ -32,7 +32,7 @@ jobs:
3232
inputs:
3333
versionSpec: 5.6.0
3434

35-
- task: DotNetCoreCLI@2
35+
- task: DotNetCoreCLI@2
3636
inputs:
3737
command: custom
3838
custom: tool
@@ -45,12 +45,12 @@ jobs:
4545
#- powershell: .\build\Install-WindowsSdkISO.ps1 19041
4646
# displayName: Insider SDK
4747

48-
- powershell: .\build\build.ps1 -target=Build
48+
- powershell: .\build\build.ps1 -Target Build
4949
displayName: Build
5050

5151
### Unit Tests ###
52-
53-
- powershell: .\build\build.ps1 -target=Test
52+
53+
- powershell: .\build\build.ps1 -Target Test
5454
displayName: Test
5555

5656
- task: PublishTestResults@2
@@ -62,7 +62,7 @@ jobs:
6262

6363
### UI Integration Tests ###
6464

65-
- powershell: .\build\build.ps1 -target=UITest
65+
- powershell: .\build\build.ps1 -Target UITest
6666
displayName: UI Integration Tests
6767

6868
- task: PublishPipelineArtifact@1
@@ -81,7 +81,7 @@ jobs:
8181

8282
### Package ###
8383

84-
- powershell: .\build\build.ps1 -target=Package
84+
- powershell: .\build\build.ps1 -Target Package
8585
displayName: Package
8686

8787
- task: PowerShell@2
@@ -105,15 +105,15 @@ jobs:
105105
- job: SmokeTests
106106
dependsOn: BuildBits
107107
timeoutInMinutes: 60
108-
108+
109109
steps:
110110
- task: DownloadPipelineArtifact@2
111111
displayName: Download NuGet Packages Artifact
112112
inputs:
113113
artifact: Packages
114114
path: .\bin\nupkg
115115

116-
- task: DotNetCoreCLI@2
116+
- task: DotNetCoreCLI@2
117117
inputs:
118118
command: custom
119119
custom: tool
@@ -123,7 +123,7 @@ jobs:
123123
- script: nbgv cloud
124124
displayName: Set Version
125125

126-
- powershell: .\build\build.ps1 -target=SmokeTest
126+
- powershell: .\build\build.ps1 -Target SmokeTest
127127
displayName: SmokeTest
128128

129129
- task: CopyFiles@2

build/Find-WindowsSDKVersions.ps1

Lines changed: 29 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,16 @@ $ErrorActionPreference = 'Stop'
55
# Unique set of Windows SDK versions referenced in files
66
$versions = New-Object System.Collections.Generic.HashSet[System.String]
77

8-
function Get-Nodes
9-
{
8+
function Get-Nodes {
109
param(
11-
[parameter(ValueFromPipeline=$true)]
12-
[xml] $xml,
13-
[parameter(Mandatory=$true)]
10+
[parameter(ValueFromPipeline = $true)]
11+
[xml] $xml,
12+
[parameter(Mandatory = $true)]
1413
[string] $nodeName)
1514

1615
# Try the old style csproj. Also format required for .targets and .props files
1716
$n = Select-Xml -Xml $xml.Project -Namespace @{d = $ns } -XPath "//d:$nodeName"
18-
17+
1918
# Try the SDK-style files
2019
if (!$n) {
2120
$r = Select-Xml -Xml $xml.Project -XPath "//$nodeName"
@@ -24,11 +23,10 @@ function Get-Nodes
2423
return $r
2524
}
2625

27-
function Get-NodeValue
28-
{
26+
function Get-NodeValue {
2927
param(
30-
[parameter(ValueFromPipeline=$true)]
31-
[xml] $xml,
28+
[parameter(ValueFromPipeline = $true)]
29+
[xml] $xml,
3230
[string] $nodeName)
3331

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

45-
function Get-SdkVersion
46-
{
43+
function Get-SdkVersion {
4744
param(
48-
[Parameter(ValueFromPipeline=$true)] $file)
45+
[Parameter(ValueFromPipeline = $true)] $file)
4946

5047
[xml] $xml = Get-Content $file
5148

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

70-
function Test-RegistryPathAndValue
71-
{
67+
function Test-RegistryPathAndValue {
7268
param (
73-
[parameter(Mandatory=$true)]
69+
[parameter(Mandatory = $true)]
7470
[ValidateNotNullOrEmpty()]
7571
[string] $path,
76-
[parameter(Mandatory=$true)]
72+
[parameter(Mandatory = $true)]
7773
[ValidateNotNullOrEmpty()]
7874
[string] $value)
7975

80-
try
81-
{
82-
if (Test-Path $path)
83-
{
76+
try {
77+
if (Test-Path $path) {
8478
Get-ItemProperty -Path $path | Select-Object -ExpandProperty $value -ErrorAction Stop | Out-Null
8579
return $true
8680
}
8781
}
88-
catch
89-
{
82+
catch {
9083
}
9184

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

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

104-
if (Test-RegistryPathAndValue -Path $WindowsSDKRegPath -Value $WindowsSDKRegRootKey)
105-
{
97+
if (Test-RegistryPathAndValue -Path $WindowsSDKRegPath -Value $WindowsSDKRegRootKey) {
10698
# A Windows SDK is installed
10799
# Is an SDK of our version installed with the options we need?
108-
if (Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value "$WindowsSDKOptions")
109-
{
100+
if (Test-RegistryPathAndValue -Path $WindowsSDKInstalledRegPath -Value "$WindowsSDKOptions") {
110101
# It appears we have what we need. Double check the disk
111102
$sdkRoot = Get-ItemProperty -Path $WindowsSDKRegPath | Select-Object -ExpandProperty $WindowsSDKRegRootKey
112-
if ($sdkRoot)
113-
{
114-
if (Test-Path $sdkRoot)
115-
{
103+
if ($sdkRoot) {
104+
if (Test-Path $sdkRoot) {
116105
$refPath = Join-Path $sdkRoot "References\$WindowsSDKVersion"
117-
if (Test-Path $refPath)
118-
{
106+
if (Test-Path $refPath) {
119107
$umdPath = Join-Path $sdkRoot "UnionMetadata\$WindowsSDKVersion"
120-
if (Test-Path $umdPath)
121-
{
108+
if (Test-Path $umdPath) {
122109
# Pretty sure we have what we need
123110
$retval = $false
124111
}
@@ -131,13 +118,13 @@ function Test-InstallWindowsSdk([string] $WindowsSDKVersion) {
131118
return $retval
132119
}
133120

134-
if(!$PSScriptRoot){
121+
if (!$PSScriptRoot) {
135122
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
136123
}
137124

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

140-
Get-ChildItem *.csproj -Recurse | ForEach-Object { get-sdkversion $_}
127+
Get-ChildItem *.csproj -Recurse | ForEach-Object { get-sdkversion $_ }
141128
Get-ChildItem *.targets -Recurse | ForEach-Object { get-sdkversion $_ }
142129
Get-ChildItem *.props -Recurse | ForEach-Object { get-sdkversion $_ }
143130

@@ -146,20 +133,21 @@ Write-Host
146133

147134
$anyInstallRequired = $false;
148135

149-
foreach($version in $versions) {
136+
foreach ($version in $versions) {
150137
if ($version -match "10\.0\.\d{5}\.0") {
151138
$installRequired = Test-InstallWindowsSDK $version
152139
Write-Host "Windows SDK '$version' install required: $installRequired"
153-
if ($installRequired) {
140+
if ($installRequired) {
154141
# Automatically invoke Install-WindowsSDKIso.ps1 ?
155142
$anyInstallRequired = $true
156143
}
157144
}
158145
}
159146

160147
Write-Host
161-
if ($anyInstallRequired) {
148+
if ($anyInstallRequired) {
162149
throw "At least one Windows SDK is missing from this machine"
163-
} else {
150+
}
151+
else {
164152
Write-Host "All referenced Windows SDKs are installed!"
165153
}

build/Install-WindowsSDK.ps1

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
mkdir c:\winsdktemp
21

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

6-
Start-Process -Wait "c:\winsdktemp\winsdksetup.exe" "/features OptionId.UWPCpp /q"
5+
mkdir $WinSdkTempDir
6+
7+
$client = [System.Net.WebClient]::new()
8+
$client.DownloadFile("https://go.microsoft.com/fwlink/p/?linkid=870807", $WinSdkSetupExe)
9+
10+
Start-Process -Wait $WinSdkSetupExe "/features OptionId.UWPCpp /q"

0 commit comments

Comments
 (0)