@@ -492,7 +492,7 @@ if ($Android -and ($HostPlatform -ne $KnownPlatforms["WindowsX64"])) {
492
492
}
493
493
494
494
# Resolve the architectures received as argument
495
- $AndroidSDKPlatforms = @ ($AndroidSDKs | ForEach-Object {
495
+ $AndroidSDKBuilds = @ ($AndroidSDKs | ForEach-Object {
496
496
switch ($_ ) {
497
497
" aarch64" { $KnownPlatforms [" AndroidARM64" ] }
498
498
" armv7" { $KnownPlatforms [" AndroidARMv7" ] }
@@ -502,7 +502,7 @@ $AndroidSDKPlatforms = @($AndroidSDKs | ForEach-Object {
502
502
}
503
503
})
504
504
505
- $WindowsSDKPlatforms = @ ($WindowsSDKs | ForEach-Object {
505
+ $WindowsSDKBuilds = @ ($WindowsSDKs | ForEach-Object {
506
506
switch ($_ ) {
507
507
" X64" { $KnownPlatforms [" WindowsX64" ] }
508
508
" X86" { $KnownPlatforms [" WindowsX86" ] }
@@ -1189,14 +1189,14 @@ function Get-Dependencies {
1189
1189
$script :CustomWinSDKRoot = " $NugetRoot \$Package .$WinSDKVersion \c"
1190
1190
1191
1191
# Install each required architecture package and move files under the base /lib directory.
1192
- $WinSDKPlatforms = $WindowsSDKPlatforms .Clone ()
1193
- if (-not ($HostPlatform -in $WinSDKPlatforms )) {
1194
- $WinSDKPlatforms += $HostPlatform
1192
+ $Builds = $WindowsSDKBuilds .Clone ()
1193
+ if (-not ($HostPlatform -in $Builds )) {
1194
+ $Builds += $HostPlatform
1195
1195
}
1196
1196
1197
- foreach ($Platform in $WinSDKPlatforms ) {
1198
- Invoke-Program nuget install $Package .$ ($Platform .Architecture.ShortName ) - Version $WinSDKVersion - OutputDirectory $NugetRoot
1199
- Copy-Directory " $NugetRoot \$Package .$ ( $Platform .Architecture.ShortName ) .$WinSDKVersion \c\*" " $CustomWinSDKRoot \lib\$WinSDKVersion "
1197
+ foreach ($Build in $Builds ) {
1198
+ Invoke-Program nuget install $Package .$ ($Build .Architecture.ShortName ) - Version $WinSDKVersion - OutputDirectory $NugetRoot
1199
+ Copy-Directory " $NugetRoot \$Package .$ ( $Build .Architecture.ShortName ) .$WinSDKVersion \c\*" " $CustomWinSDKRoot \lib\$WinSDKVersion "
1200
1200
}
1201
1201
}
1202
1202
}
@@ -2708,13 +2708,13 @@ function Write-SDKSettings([OS] $OS, [string] $Identifier = $OS.ToString()) {
2708
2708
$SDKSettings.SupportedTargets.windows.LLVMTargetVendor = " unknown"
2709
2709
$SDKSettings.SupportedTargets.windows.LLVMTargetSys = " windows"
2710
2710
$SDKSettings.SupportedTargets.windows.LLVMTargetTripleEnvironment = " msvc"
2711
- $SDKSettings.SupportedTargets.windows.Archs = $WindowsSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName } | Sort-Object
2711
+ $SDKSettings.SupportedTargets.windows.Archs = $WindowsSDKBuilds | ForEach-Object { $_.Architecture.LLVMName } | Sort-Object
2712
2712
}
2713
2713
Android {
2714
2714
$SDKSettings.SupportedTargets.android.LLVMTargetVendor = " unknown"
2715
2715
$SDKSettings.SupportedTargets.android.LLVMTargetSys = " linux"
2716
2716
$SDKSettings.SupportedTargets.android.LLVMTargetTripleEnvironment = " android${AndroidAPILevel} "
2717
- $SDKSettings.SupportedTargets.android.Archs = $AndroidSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName } | Sort-Object
2717
+ $SDKSettings.SupportedTargets.android.Archs = $AndroidSDKBuilds | ForEach-Object { $_.Architecture.LLVMName } | Sort-Object
2718
2718
}
2719
2719
}
2720
2720
$SDKSettings | ConvertTo-JSON - Depth 4 | Out-FIle - FilePath " $ ( Get-SwiftSDK $OS - Identifier $Identifier ) \SDKSettings.json"
@@ -3610,11 +3610,11 @@ function Build-Installer([Hashtable] $Platform) {
3610
3610
}
3611
3611
3612
3612
$Properties [" Platforms" ] = " `" windows$ ( if ($Android ) { " ;android" }) `" " ;
3613
- $Properties [" AndroidArchitectures" ] = " `" $ ( ($AndroidSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3614
- $Properties [" WindowsArchitectures" ] = " `" $ ( ($WindowsSDKPlatforms | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3613
+ $Properties [" AndroidArchitectures" ] = " `" $ ( ($AndroidSDKBuilds | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3614
+ $Properties [" WindowsArchitectures" ] = " `" $ ( ($WindowsSDKBuilds | ForEach-Object { $_.Architecture.LLVMName }) -Join " ;" ) `" "
3615
3615
$Properties [" ToolchainVariants" ] = " `" asserts$ ( if ($IncludeNoAsserts ) { " ;noasserts" }) `" " ;
3616
- foreach ($SDKPlatform in $WindowsSDKPlatforms ) {
3617
- $Properties [" WindowsRuntime$ ( $SDKPlatform .Architecture.ShortName.ToUpperInvariant ()) " ] = [IO.Path ]::Combine((Get-InstallDir $SDKPlatform ), " Runtimes" , " $ProductVersion " );
3616
+ foreach ($Build in $WindowsSDKBuilds ) {
3617
+ $Properties [" WindowsRuntime$ ( $Build .Architecture.ShortName.ToUpperInvariant ()) " ] = [IO.Path ]::Combine((Get-InstallDir $Build ), " Runtimes" , " $ProductVersion " );
3618
3618
}
3619
3619
3620
3620
Build-WiXProject bundle\installer.wixproj - Platform $Platform - Bundle - Properties $Properties
@@ -3623,8 +3623,8 @@ function Build-Installer([Hashtable] $Platform) {
3623
3623
function Copy-BuildArtifactsToStage ([Hashtable ] $Platform ) {
3624
3624
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.cab" $Stage
3625
3625
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \*.msi" $Stage
3626
- foreach ($SDKPlatform in $WindowsSDKPlatforms ) {
3627
- Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $SDKPlatform .Architecture.VSName ) \*.msm" $Stage
3626
+ foreach ($Build in $WindowsSDKBuilds ) {
3627
+ Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Build .Architecture.VSName ) \*.msm" $Stage
3628
3628
}
3629
3629
Copy-File " $BinaryCache \$ ( $Platform.Triple ) \installer\Release\$ ( $Platform.Architecture.VSName ) \installer.exe" $Stage
3630
3630
# Extract installer engine to ease code-signing on swift.org CI
@@ -3675,11 +3675,11 @@ Get-Dependencies
3675
3675
if ($Clean ) {
3676
3676
Remove-Item - Force - Recurse - Path " $BinaryCache \$ ( $BuildPlatform.Triple ) \" - ErrorAction Ignore
3677
3677
Remove-Item - Force - Recurse - Path " $BinaryCache \$ ( $HostPlatform.Triple ) \" - ErrorAction Ignore
3678
- foreach ($Platform in $WindowsSDKPlatforms ) {
3679
- Remove-Item - Force - Recurse - Path " $BinaryCache \$ ( $Platform .Triple ) \" - ErrorAction Ignore
3678
+ foreach ($Build in $WindowsSDKBuilds ) {
3679
+ Remove-Item - Force - Recurse - Path " $BinaryCache \$ ( $Build .Triple ) \" - ErrorAction Ignore
3680
3680
}
3681
- foreach ($Platform in $AndroidSDKPlatforms ) {
3682
- Remove-Item - Force - Recurse - Path " $BinaryCache \$ ( $Platform .Triple ) \" - ErrorAction Ignore
3681
+ foreach ($Build in $AndroidSDKBuilds ) {
3682
+ Remove-Item - Force - Recurse - Path " $BinaryCache \$ ( $Build .Triple ) \" - ErrorAction Ignore
3683
3683
}
3684
3684
Remove-Item - Force - Recurse - Path " $BinaryCache \1" - ErrorAction Ignore
3685
3685
Remove-Item - Force - Recurse - Path " $BinaryCache \5" - ErrorAction Ignore
@@ -3709,55 +3709,55 @@ if (-not $SkipBuild) {
3709
3709
3710
3710
Invoke-BuildStep Build-SDK $BuildPlatform - IncludeMacros
3711
3711
3712
- foreach ($Platform in $WindowsSDKPlatforms ) {
3713
- Invoke-BuildStep Build-SDK $Platform
3712
+ foreach ($Build in $WindowsSDKBuilds ) {
3713
+ Invoke-BuildStep Build-SDK $Build
3714
3714
3715
3715
Get-ChildItem " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3716
3716
Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3717
- Move-Item $_.FullName " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows\$ ( $Platform .Architecture.LLVMName ) \" | Out-Null
3717
+ Move-Item $_.FullName " $ ( Get-SwiftSDK Windows) \usr\lib\swift\windows\$ ( $Build .Architecture.LLVMName ) \" | Out-Null
3718
3718
}
3719
3719
3720
- Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Platform ), " Runtimes" , $ProductVersion , " usr" )) "
3720
+ Copy-Directory " $ ( Get-SwiftSDK Windows) \usr\bin" " $ ( [IO.Path ]::Combine((Get-InstallDir $Build ), " Runtimes" , $ProductVersion , " usr" )) "
3721
3721
3722
- Invoke-BuildStep Build-ExperimentalSDK $Platform
3722
+ Invoke-BuildStep Build-ExperimentalSDK $Build
3723
3723
3724
3724
Get-ChildItem " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static\windows" - Filter " *.lib" - File - ErrorAction Ignore | ForEach-Object {
3725
3725
Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3726
- Move-Item $_.FullName " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static\windows\$ ( $Platform .Architecture.LLVMName ) \" | Out-Null
3726
+ Move-Item $_.FullName " $ ( Get-SwiftSDK Windows - Identifier WindowsExperimental) \usr\lib\swift_static\windows\$ ( $Build .Architecture.LLVMName ) \" | Out-Null
3727
3727
}
3728
3728
}
3729
3729
3730
3730
Write-PlatformInfoPlist Windows
3731
- Install-SDK $WindowsSDKPlatforms
3731
+ Install-SDK $WindowsSDKBuilds
3732
3732
Write-SDKSettings Windows
3733
- Install-SDK $WindowsSDKPlatforms - Identifier WindowsExperimental
3733
+ Install-SDK $WindowsSDKBuilds - Identifier WindowsExperimental
3734
3734
Write-SDKSettings Windows - Identifier WindowsExperimental
3735
3735
3736
3736
if ($Android ) {
3737
- foreach ($Platform in $AndroidSDKPlatforms ) {
3738
- Invoke-BuildStep Build-SDK $Platform
3737
+ foreach ($Build in $AndroidSDKBuilds ) {
3738
+ Invoke-BuildStep Build-SDK $Build
3739
3739
3740
3740
Get-ChildItem " $ ( Get-SwiftSDK Android) \usr\lib\swift\android" - File | Where-Object { $_.Name -match " .a$|.so$" } | ForEach-Object {
3741
3741
Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3742
- Move-Item $_.FullName " $ ( Get-SwiftSDK Android) \usr\lib\swift\android\$ ( $Platform .Architecture.LLVMName ) \" | Out-Null
3742
+ Move-Item $_.FullName " $ ( Get-SwiftSDK Android) \usr\lib\swift\android\$ ( $Build .Architecture.LLVMName ) \" | Out-Null
3743
3743
}
3744
3744
3745
- Invoke-BuildStep Build-ExperimentalSDK $Platform
3745
+ Invoke-BuildStep Build-ExperimentalSDK $Build
3746
3746
3747
3747
Get-ChildItem " $ ( Get-SwiftSDK Android - Identifier AndroidExperimental) \usr\lib\swift_static\android" - File | Where-Object { $_.Name -match " .a$|.so$" } | ForEach-Object {
3748
3748
Write-Host - BackgroundColor DarkRed - ForegroundColor White " $ ( $_.FullName ) is not nested in an architecture directory"
3749
- Move-Item $_.FullName " $ ( Get-SwiftSDK Android - Identifier AndroidExperimental) \usr\lib\swift_static\android\$ ( $Platform .Architecture.LLVMName ) \" | Out-Null
3749
+ Move-Item $_.FullName " $ ( Get-SwiftSDK Android - Identifier AndroidExperimental) \usr\lib\swift_static\android\$ ( $Build .Architecture.LLVMName ) \" | Out-Null
3750
3750
}
3751
3751
}
3752
3752
3753
3753
Write-PlatformInfoPlist Android
3754
- Install-SDK $AndroidSDKPlatforms
3754
+ Install-SDK $AndroidSDKBuilds
3755
3755
Write-SDKSettings Android
3756
- Install-SDK $AndroidSDKPlatforms - Identifiers AndroidExperimental
3756
+ Install-SDK $AndroidSDKBuilds - Identifiers AndroidExperimental
3757
3757
Write-SDKSettings Android - Identifier AndroidExperimental
3758
3758
3759
3759
# Android swift-inspect only supports 64-bit platforms.
3760
- $AndroidSDKPlatforms | Where-Object { @ (" arm64-v8a" , " x86_64" ) -contains $_.Architecture.ABI } | ForEach-Object {
3760
+ $AndroidSDKBuilds | Where-Object { @ (" arm64-v8a" , " x86_64" ) -contains $_.Architecture.ABI } | ForEach-Object {
3761
3761
Invoke-BuildStep Build-Inspect $_
3762
3762
}
3763
3763
}
@@ -3834,10 +3834,11 @@ if (-not $IsCrossCompiling) {
3834
3834
if ($Test -contains " sourcekit-lsp" ) { Invoke-BuildStep Test-SourceKitLSP $BuildPlatform }
3835
3835
3836
3836
if ($Test -contains " swift" ) {
3837
- foreach ($Platform in $AndroidSDKPlatforms ) {
3837
+ foreach ($Build in $AndroidSDKBuilds ) {
3838
3838
try {
3839
- Invoke-BuildStep Test-Runtime $Platform
3840
- } catch {}
3839
+ Invoke-BuildStep Test-Runtime $Build
3840
+ } catch {
3841
+ }
3841
3842
}
3842
3843
}
3843
3844
}
0 commit comments