Skip to content

Commit 43e6508

Browse files
compnerdfinagolfin
authored andcommitted
build.ps1: extract XCTest from Build-SDK
Strip out `Build-XCTest` from `Build-SDK`. This is done against the default SDK now for each architecture after the full SDK is built.
1 parent c987ea9 commit 43e6508

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

utils/build.ps1

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,15 @@ param
188188
[string] $AndroidNDKVersion = "r27c",
189189
[ValidateRange(1, 36)]
190190
[int] $AndroidAPILevel = 28,
191+
[string] $AndroidSDKDefault = "Android",
191192
[string[]] $AndroidSDKVersions = @("Android", "AndroidExperimental"),
192193
[string[]] $AndroidSDKArchitectures = @("aarch64", "armv7", "i686", "x86_64"),
193194

194195
# Windows SDK Options
195196
[switch] $Windows = $true,
196197
[ValidatePattern("^\d+\.\d+\.\d+(?:-\w+)?")]
197198
[string] $WinSDKVersion = "",
199+
[string] $WindowsSDKDefault = "Windows",
198200
[string[]] $WindowsSDKVersions = @("Windows", "WindowsExperimental"),
199201
[string[]] $WindowsSDKArchitectures = @("X64","X86","Arm64"),
200202

@@ -291,6 +293,7 @@ $KnownPlatforms = @{
291293
};
292294
BinaryDir = "bin64a";
293295
Cache = @{};
296+
DefaultSDK = $WindowsSDKDefault;
294297
};
295298

296299
WindowsX64 = @{
@@ -304,6 +307,7 @@ $KnownPlatforms = @{
304307
};
305308
BinaryDir = "bin64";
306309
Cache = @{};
310+
DefaultSDK = $WindowsSDKDefault;
307311
};
308312

309313
WindowsX86 = @{
@@ -317,6 +321,7 @@ $KnownPlatforms = @{
317321
};
318322
BinaryDir = "bin32";
319323
Cache = @{};
324+
DefaultSDK = $WindowsSDKDefault;
320325
};
321326

322327
AndroidARMv7 = @{
@@ -330,6 +335,7 @@ $KnownPlatforms = @{
330335
};
331336
BinaryDir = "bin32a";
332337
Cache = @{};
338+
DefaultSDK = $AndroidSDKDefault;
333339
};
334340

335341
AndroidARM64 = @{
@@ -343,6 +349,7 @@ $KnownPlatforms = @{
343349
};
344350
BinaryDir = "bin64a";
345351
Cache = @{};
352+
DefaultSDK = $AndroidSDKDefault;
346353
};
347354

348355
AndroidX86 = @{
@@ -356,6 +363,7 @@ $KnownPlatforms = @{
356363
};
357364
BinaryDir = "bin32";
358365
Cache = @{};
366+
DefaultSDK = $AndroidSDKDefault;
359367
};
360368

361369
AndroidX64 = @{
@@ -369,6 +377,7 @@ $KnownPlatforms = @{
369377
};
370378
BinaryDir = "bin64";
371379
Cache = @{};
380+
DefaultSDK = $AndroidSDKDefault;
372381
};
373382
}
374383

@@ -3001,13 +3010,11 @@ function Build-XCTest([Hashtable] $Platform) {
30013010
-InstallTo "$([IO.Path]::Combine((Get-PlatformRoot $Platform.OS), "Developer", "Library", "XCTest-$ProductVersion", "usr"))" `
30023011
-Platform $Platform `
30033012
-UseBuiltCompilers Swift `
3004-
-SwiftSDK (Get-SwiftSDK $Platform.OS) `
3013+
-SwiftSDK (Get-SwiftSDK -OS $Platform.OS -Identifier $Platform.DefaultSDK) `
30053014
-Defines @{
30063015
BUILD_SHARED_LIBS = "YES";
30073016
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir;
30083017
ENABLE_TESTING = "NO";
3009-
dispatch_DIR = $(Get-ProjectCMakeModules $Platform Dispatch);
3010-
Foundation_DIR = $(Get-ProjectCMakeModules $Platform DynamicFoundation);
30113018
XCTest_INSTALL_NESTED_SUBDIR = "YES";
30123019
}
30133020
}
@@ -3029,8 +3036,6 @@ function Test-XCTest {
30293036
-Defines @{
30303037
CMAKE_Swift_FLAGS = @("-resource-dir", $SwiftRuntimeDirectory, "-vfsoverlay", "${RuntimeBinaryCache}\stdlib\windows-vfs-overlay.yaml");
30313038
ENABLE_TESTING = "YES";
3032-
dispatch_DIR = $(Get-ProjectCMakeModules $BuildPlatform Dispatch);
3033-
Foundation_DIR = $(Get-ProjectCMakeModules $BuildPlatform DynamicFoundation);
30343039
LLVM_DIR = "$(Get-ProjectBinaryCache $BuildPlatform LLVM)\lib\cmake\llvm";
30353040
XCTEST_PATH_TO_FOUNDATION_BUILD = $(Get-ProjectBinaryCache $BuildPlatform DynamicFoundation);
30363041
XCTEST_PATH_TO_LIBDISPATCH_BUILD = $(Get-ProjectBinaryCache $BuildPlatform Dispatch);
@@ -3111,8 +3116,7 @@ function Build-SDK([Hashtable] $Platform) {
31113116
Invoke-BuildStep Build-Runtime $Platform
31123117
Invoke-BuildStep Build-Dispatch $Platform
31133118
Invoke-BuildStep Build-Foundation $Platform
3114-
Invoke-BuildStep Build-CompilerRuntime $Platform
3115-
Invoke-BuildStep Build-XCTest $Platform
3119+
31163120
Invoke-BuildStep Build-Testing $Platform
31173121
}
31183122

@@ -4009,6 +4013,10 @@ if (-not $SkipBuild) {
40094013
}
40104014
}
40114015

4016+
foreach ($Build in $WindowsSDKBuilds) {
4017+
Invoke-BuildStep Build-XCTest $Build
4018+
}
4019+
40124020
Write-PlatformInfoPlist Windows
40134021
}
40144022

@@ -4062,6 +4070,10 @@ if (-not $SkipBuild) {
40624070
}
40634071
}
40644072

4073+
foreach ($Build in $AndroidSDKBuilds) {
4074+
Invoke-BuildStep Build-XCTest $Build
4075+
}
4076+
40654077
Write-PlatformInfoPlist Android
40664078

40674079
# Android swift-inspect only supports 64-bit platforms.

0 commit comments

Comments
 (0)