Skip to content

Commit cb757bc

Browse files
committed
utils: adjust tree layout modification logic for static SDKs
This adjusts the layout to now package up the static SDK properly.
1 parent 06aa42b commit cb757bc

File tree

1 file changed

+16
-3
lines changed

1 file changed

+16
-3
lines changed

utils/build.ps1

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -787,7 +787,8 @@ function Move-Directory($Src, $Dst) {
787787
if (Test-Path -Path $Destination -Type Container) {
788788
Remove-Item -Path $Destination -Recurse -Force | Out-Null
789789
}
790-
Move-Item -Path $Src -Destination $Dst -Force | Out-Null
790+
New-Item -ItemType Directory -ErrorAction Ignore $Dst | Out-Null
791+
Move-Item -Path $Src -Destination $Destination -Force | Out-Null
791792
}
792793
}
793794

@@ -3408,14 +3409,20 @@ if (-not $SkipBuild) {
34083409

34093410
foreach ($Platform in $WindowsSDKPlatforms) {
34103411
Invoke-BuildStep Build-SDK $Platform
3411-
Invoke-BuildStep Build-ExperimentalSDK $Platform
34123412

34133413
Get-ChildItem "$(Get-SwiftSDK Windows)\usr\lib\swift\windows" -Filter "*.lib" -File -ErrorAction Ignore | ForEach-Object {
34143414
Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory"
34153415
Move-Item $_.FullName "$(Get-SwiftSDK Windows)\usr\lib\swift\windows\$($Platform.Architecture.LLVMName)\" | Out-Null
34163416
}
34173417

34183418
Copy-Directory "$(Get-SwiftSDK Windows)\usr\bin" "$([IO.Path]::Combine((Get-InstallDir $Platform), "Runtimes", $ProductVersion, "usr"))"
3419+
3420+
Invoke-BuildStep Build-ExperimentalSDK $Platform
3421+
3422+
Get-ChildItem "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\usr\lib\swift_static\windows" -Filter "*.lib" -File -ErrorAction Ignore | ForEach-Object {
3423+
Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory"
3424+
Move-Item $_.FullName "$(Get-SwiftSDK Windows -Identifier WindowsExperimental)\usr\lib\swift_static\windows\$($Platform.Architecture.LLVMName)\" | Out-Null
3425+
}
34193426
}
34203427

34213428
Write-PlatformInfoPlist Windows
@@ -3427,12 +3434,18 @@ if (-not $SkipBuild) {
34273434
if ($Android) {
34283435
foreach ($Platform in $AndroidSDKPlatforms) {
34293436
Invoke-BuildStep Build-SDK $Platform
3430-
Invoke-BuildStep Build-ExperimentalSDK $Platform
34313437

34323438
Get-ChildItem "$(Get-SwiftSDK Android)\usr\lib\swift\android" -File | Where-Object { $_.Name -match ".a$|.so$" } | ForEach-Object {
34333439
Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory"
34343440
Move-Item $_.FullName "$(Get-SwiftSDK Android)\usr\lib\swift\android\$($Platform.Architecture.LLVMName)\" | Out-Null
34353441
}
3442+
3443+
Invoke-BuildStep Build-ExperimentalSDK $Platform
3444+
3445+
Get-ChildItem "$(Get-SwiftSDK Android -Identifier AndroidExperimental)\usr\lib\swift_static\android" -File | Where-Object { $_.Name -match ".a$|.so$" } | ForEach-Object {
3446+
Write-Host -BackgroundColor DarkRed -ForegroundColor White "$($_.FullName) is not nested in an architecture directory"
3447+
Move-Item $_.FullName "$(Get-SwiftSDK Android -Identifier AndroidExperimental)\usr\lib\swift_static\android\$($Platform.Architecture.LLVMName)\" | Out-Null
3448+
}
34363449
}
34373450

34383451
Write-PlatformInfoPlist Android

0 commit comments

Comments
 (0)