Skip to content

Commit dc88545

Browse files
committed
utils: rework Build-Testing to exclude -Test
Simplify the `Build-Testing` call to simply build swift testing for distribution. The testing support was never implemented and there was more duplication than necessary.
1 parent 8840477 commit dc88545

File tree

1 file changed

+16
-28
lines changed

1 file changed

+16
-28
lines changed

utils/build.ps1

Lines changed: 16 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2380,35 +2380,23 @@ function Test-XCTest {
23802380
}
23812381
}
23822382

2383-
function Build-Testing([Platform]$Platform, $Arch, [switch]$Test = $false) {
2384-
$DispatchBinaryCache = Get-TargetProjectBinaryCache $Arch Dispatch
2385-
$FoundationBinaryCache = Get-TargetProjectBinaryCache $Arch DynamicFoundation
2386-
$SwiftTestingBinaryCache = Get-TargetProjectBinaryCache $Arch Testing
2387-
2388-
Isolate-EnvVars {
2389-
if ($Test) {
2390-
# TODO: Test
2391-
return
2392-
} else {
2393-
$InstallPath = "$($Arch.SwiftTestingInstallRoot)\usr"
2383+
function Build-Testing([Platform]$Platform, $Arch) {
2384+
Build-CMakeProject `
2385+
-Src $SourceCache\swift-testing `
2386+
-Bin (Get-TargetProjectBinaryCache $Arch Testing) `
2387+
-InstallTo "$($Arch.SwiftTestingInstallRoot)\usr" `
2388+
-Arch $Arch `
2389+
-Platform $Platform `
2390+
-UseBuiltCompilers C,CXX,Swift `
2391+
-Defines @{
2392+
BUILD_SHARED_LIBS = "YES";
2393+
CMAKE_BUILD_WITH_INSTALL_RPATH = "YES";
2394+
dispatch_DIR = (Get-TargetProjectCMakeModules $Arch Dispatch);
2395+
Foundation_DIR = (Get-TargetProjectCMakeModules $Arch DynamicFoundation);
2396+
# TODO: ensure that host and target platform match
2397+
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2398+
SwiftTesting_MACRO = "$(Get-BuildProjectBinaryCache TestingMacros)\TestingMacros.dll";
23942399
}
2395-
2396-
Build-CMakeProject `
2397-
-Src $SourceCache\swift-testing `
2398-
-Bin $SwiftTestingBinaryCache `
2399-
-InstallTo $InstallPath `
2400-
-Arch $Arch `
2401-
-Platform $Platform `
2402-
-UseBuiltCompilers C,CXX,Swift `
2403-
-Defines (@{
2404-
BUILD_SHARED_LIBS = "YES";
2405-
CMAKE_BUILD_WITH_INSTALL_RPATH = "YES";
2406-
dispatch_DIR = "$DispatchBinaryCache\cmake\modules";
2407-
Foundation_DIR = "$FoundationBinaryCache\cmake\modules";
2408-
SwiftSyntax_DIR = (Get-HostProjectCMakeModules Compilers);
2409-
SwiftTesting_MACRO = "$(Get-BuildProjectBinaryCache TestingMacros)\TestingMacros.dll";
2410-
})
2411-
}
24122400
}
24132401

24142402
function Write-PlatformInfoPlist([Platform] $Platform) {

0 commit comments

Comments
 (0)