Skip to content

Commit 5bf28be

Browse files
authored
Merge pull request #71562 from compnerd/parameter-names
utils: adjust parameter for SDKs in build.ps1
2 parents 693f330 + de7f292 commit 5bf28be

File tree

1 file changed

+14
-13
lines changed

1 file changed

+14
-13
lines changed

utils/build.ps1

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ The debug information format for C/C++ code: dwarf or codeview.
3232
.PARAMETER SwiftDebugFormat
3333
The debug information format for Swift code: dwarf or codeview.
3434
35-
.PARAMETER SDKs
36-
An array of architectures for which the Swift SDK should be built.
35+
.PARAMETER WindowsSDKs
36+
An array of architectures for which the Windows Swift SDK should be built.
3737
3838
.PARAMETER ProductVersion
3939
The product version to be used when building the installer.
@@ -84,7 +84,7 @@ in batch file format instead of executing them.
8484
PS> .\Build.ps1
8585
8686
.EXAMPLE
87-
PS> .\Build.ps1 -SDKs x64 -ProductVersion 1.2.3 -Test foundation,xctest
87+
PS> .\Build.ps1 -WindowsSDKs x64 -ProductVersion 1.2.3 -Test foundation,xctest
8888
#>
8989
[CmdletBinding(PositionalBinding = $false)]
9090
param(
@@ -93,7 +93,7 @@ param(
9393
[string] $ImageRoot = "S:",
9494
[string] $CDebugFormat = "dwarf",
9595
[string] $SwiftDebugFormat = "dwarf",
96-
[string[]] $SDKs = @("X64","X86","Arm64"),
96+
[string[]] $WindowsSDKs = @("X64","X86","Arm64"),
9797
[string] $ProductVersion = "0.0.0",
9898
[string] $PinnedBuild = "https://download.swift.org/swift-5.9-release/windows10/swift-5.9-RELEASE/swift-5.9-RELEASE-windows10.exe",
9999
[string] $PinnedSHA256 = "EAB668ABFF903B4B8111FD27F49BAD470044B6403C6FA9CCD357AE831909856D",
@@ -146,7 +146,7 @@ if (-not (Test-Path $python)) {
146146
}
147147

148148
# Work around limitations of cmd passing in array arguments via powershell.exe -File
149-
if ($SDKs.Length -eq 1) { $SDKs = $SDKs[0].Split(",") }
149+
if ($WindowsSDKs.Length -eq 1) { $WindowsSDKs = $WindowsSDKs[0].Split(",") }
150150
if ($Test.Length -eq 1) { $Test = $Test[0].Split(",") }
151151

152152
if ($Test -contains "*") {
@@ -237,7 +237,7 @@ $SDKInstallRoot = "$PlatformInstallRoot\Developer\SDKs\Windows.sdk"
237237
$HostArch.ToolchainInstallRoot = $ToolchainInstallRoot
238238

239239
# Resolve the architectures received as argument
240-
$SDKArchs = @($SDKs | ForEach-Object {
240+
$WindowsSDKArchs = @($WindowsSDKs | ForEach-Object {
241241
switch ($_) {
242242
"X64" { $ArchX64 }
243243
"X86" { $ArchX86 }
@@ -449,6 +449,7 @@ function Fetch-Dependencies {
449449
$ProgressPreference = "SilentlyContinue"
450450

451451
$WebClient = New-Object Net.WebClient
452+
452453
$WiXVersion = "4.0.4"
453454
$WiXURL = "https://www.nuget.org/api/v2/package/wix/$WiXVersion"
454455
$WiXHash = "A9CA12214E61BB49430A8C6E5E48AC5AE6F27DC82573B5306955C4D35F2D34E2"
@@ -511,7 +512,7 @@ function Fetch-Dependencies {
511512
$script:CustomWinSDKRoot = "$NugetRoot\$Package.$WinSDKVersion\c"
512513

513514
# Install each required architecture package and move files under the base /lib directory.
514-
$WinSDKArchs = $SDKArchs.Clone()
515+
$WinSDKArchs = $WindowsSDKArchs.Clone()
515516
if (-not ($HostArch -in $WinSDKArchs)) {
516517
$WinSDKArch += $HostArch
517518
}
@@ -1840,7 +1841,7 @@ function Build-Installer($Arch) {
18401841
}
18411842
}
18421843

1843-
foreach ($SDK in $SDKArchs) {
1844+
foreach ($SDK in $WindowsSDKArchs) {
18441845
$Properties["INCLUDE_$($SDK.VSName.ToUpperInvariant())_SDK"] = "true"
18451846
$Properties["PLATFORM_ROOT_$($SDK.VSName.ToUpperInvariant())"] = "$($SDK.PlatformInstallRoot)\"
18461847
$Properties["SDK_ROOT_$($SDK.VSName.ToUpperInvariant())"] = "$($SDK.SDKInstallRoot)\"
@@ -1854,7 +1855,7 @@ function Stage-BuildArtifacts($Arch) {
18541855
Copy-File "$($Arch.BinaryCache)\installer\Release\$($Arch.VSName)\*.msi" "$Stage\"
18551856
Copy-File "$($Arch.BinaryCache)\installer\Release\$($Arch.VSName)\rtl.cab" "$Stage\"
18561857
Copy-File "$($Arch.BinaryCache)\installer\Release\$($Arch.VSName)\rtl.msi" "$Stage\"
1857-
foreach ($SDK in $SDKArchs) {
1858+
foreach ($SDK in $WindowsSDKArchs) {
18581859
Copy-File "$($Arch.BinaryCache)\installer\Release\$($SDK.VSName)\sdk.$($SDK.VSName).cab" "$Stage\"
18591860
Copy-File "$($Arch.BinaryCache)\installer\Release\$($SDK.VSName)\sdk.$($SDK.VSName).msi" "$Stage\"
18601861
Copy-File "$($Arch.BinaryCache)\installer\Release\$($SDK.VSName)\rtl.$($SDK.VSName).msm" "$Stage\"
@@ -1884,12 +1885,12 @@ if (-not $SkipBuild) {
18841885

18851886
if ($Clean) {
18861887
2..16 | % { Remove-Item -Force -Recurse "$BinaryCache\$_" -ErrorAction Ignore }
1887-
foreach ($Arch in $SDKArchs) {
1888+
foreach ($Arch in $WindowsSDKArchs) {
18881889
0..3 | % { Remove-Item -Force -Recurse "$BinaryCache\$($Arch.BuildiD + $_)" -ErrorAction Ignore }
18891890
}
18901891
}
18911892

1892-
foreach ($Arch in $SDKArchs) {
1893+
foreach ($Arch in $WindowsSDKArchs) {
18931894
if (-not $SkipBuild) {
18941895
Invoke-BuildStep Build-ZLib $Arch
18951896
Invoke-BuildStep Build-XML2 $Arch
@@ -1906,13 +1907,13 @@ foreach ($Arch in $SDKArchs) {
19061907
}
19071908

19081909
if (-not $ToBatch) {
1909-
if ($HostArch -in $SDKArchs) {
1910+
if ($HostArch -in $WindowsSDKArchs) {
19101911
Remove-Item -Force -Recurse $RuntimeInstallRoot -ErrorAction Ignore
19111912
Copy-Directory "$($HostArch.SDKInstallRoot)\usr\bin" "$RuntimeInstallRoot\usr"
19121913
}
19131914

19141915
Remove-Item -Force -Recurse $PlatformInstallRoot -ErrorAction Ignore
1915-
foreach ($Arch in $SDKArchs) {
1916+
foreach ($Arch in $WindowsSDKArchs) {
19161917
Install-Platform $Arch
19171918
}
19181919
}

0 commit comments

Comments
 (0)