Skip to content

Commit 7591beb

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 c80b750 commit 7591beb

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
@@ -2377,35 +2377,23 @@ function Test-XCTest {
23772377
}
23782378
}
23792379

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

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

0 commit comments

Comments
 (0)