@@ -189,13 +189,15 @@ param
189
189
[ValidateRange (1 , 36 )]
190
190
[int ] $AndroidAPILevel = 28 ,
191
191
[string []] $AndroidSDKVersions = @ (" Android" , " AndroidExperimental" ),
192
+ [string ] $AndroidSDKVersionDefault = " Android" ,
192
193
[string []] $AndroidSDKArchitectures = @ (" aarch64" , " armv7" , " i686" , " x86_64" ),
193
194
194
195
# Windows SDK Options
195
196
[switch ] $Windows = $true ,
196
197
[ValidatePattern (" ^\d+\.\d+\.\d+(?:-\w+)?" )]
197
198
[string ] $WinSDKVersion = " " ,
198
199
[string []] $WindowsSDKVersions = @ (" Windows" , " WindowsExperimental" ),
200
+ [string ] $WindowsSDKVersionDefault = " Windows" ,
199
201
[string []] $WindowsSDKArchitectures = @ (" X64" , " X86" , " Arm64" ),
200
202
201
203
# Incremental Build Support
@@ -291,6 +293,7 @@ $KnownPlatforms = @{
291
293
};
292
294
BinaryDir = " bin64a" ;
293
295
Cache = @ {};
296
+ DefaultSDK = $WindowsSDKVersionDefault ;
294
297
};
295
298
296
299
WindowsX64 = @ {
@@ -304,6 +307,7 @@ $KnownPlatforms = @{
304
307
};
305
308
BinaryDir = " bin64" ;
306
309
Cache = @ {};
310
+ DefaultSDK = $WindowsSDKVersionDefault ;
307
311
};
308
312
309
313
WindowsX86 = @ {
@@ -317,6 +321,7 @@ $KnownPlatforms = @{
317
321
};
318
322
BinaryDir = " bin32" ;
319
323
Cache = @ {};
324
+ DefaultSDK = $WindowsSDKVersionDefault ;
320
325
};
321
326
322
327
AndroidARMv7 = @ {
@@ -330,6 +335,7 @@ $KnownPlatforms = @{
330
335
};
331
336
BinaryDir = " bin32a" ;
332
337
Cache = @ {};
338
+ DefaultSDK = $AndroidSDKVersionDefault ;
333
339
};
334
340
335
341
AndroidARM64 = @ {
@@ -343,6 +349,7 @@ $KnownPlatforms = @{
343
349
};
344
350
BinaryDir = " bin64a" ;
345
351
Cache = @ {};
352
+ DefaultSDK = $AndroidSDKVersionDefault ;
346
353
};
347
354
348
355
AndroidX86 = @ {
@@ -356,6 +363,7 @@ $KnownPlatforms = @{
356
363
};
357
364
BinaryDir = " bin32" ;
358
365
Cache = @ {};
366
+ DefaultSDK = $AndroidSDKVersionDefault ;
359
367
};
360
368
361
369
AndroidX64 = @ {
@@ -369,6 +377,7 @@ $KnownPlatforms = @{
369
377
};
370
378
BinaryDir = " bin64" ;
371
379
Cache = @ {};
380
+ DefaultSDK = $AndroidSDKVersionDefault ;
372
381
};
373
382
}
374
383
@@ -3053,36 +3062,47 @@ function Build-XCTest([Hashtable] $Platform) {
3053
3062
- InstallTo " $ ( [IO.Path ]::Combine((Get-PlatformRoot $Platform.OS ), " Developer" , " Library" , " XCTest-$ProductVersion " , " usr" )) " `
3054
3063
- Platform $Platform `
3055
3064
- UseBuiltCompilers Swift `
3056
- - SwiftSDK (Get-SwiftSDK $Platform.OS ) `
3065
+ - SwiftSDK (Get-SwiftSDK - OS $Platform.OS - Identifier $Platform .DefaultSDK ) `
3057
3066
- Defines @ {
3058
3067
BUILD_SHARED_LIBS = " YES" ;
3059
3068
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir ;
3060
3069
ENABLE_TESTING = " NO" ;
3061
- dispatch_DIR = $ (Get-ProjectCMakeModules $Platform Dispatch);
3062
- Foundation_DIR = $ (Get-ProjectCMakeModules $Platform DynamicFoundation);
3063
3070
XCTest_INSTALL_NESTED_SUBDIR = " YES" ;
3064
3071
}
3065
3072
}
3066
3073
3067
3074
function Test-XCTest {
3068
3075
Invoke-IsolatingEnvVars {
3069
- $env: Path = " $ ( Get-ProjectBinaryCache $BuildPlatform XCTest) ;$ ( Get-ProjectBinaryCache $BuildPlatform DynamicFoundation) \bin;$ ( Get-ProjectBinaryCache $BuildPlatform Dispatch) ;$ ( Get-ProjectBinaryCache $BuildPlatform Runtime) \bin;${env: Path} ;$UnixToolsBinDir "
3076
+ $SwiftRuntime = if ($BuildPlatform.DefaultSDK -match " Experimental" ) {
3077
+ [IO.Path ]::Combine((Get-InstallDir $BuildPlatform ), " Runtimes" , " $ProductVersion .experimental" );
3078
+ } else {
3079
+ [IO.Path ]::Combine((Get-InstallDir $BuildPlatform ), " Runtimes" , " $ProductVersion " );
3080
+ }
3081
+
3082
+ $DispatchBinaryCache = if ($BuildPlatform.DefaultSDK -match " Experimental" ) {
3083
+ Get-ProjectBinaryCache $BuildPlatform ExperimentalDynamicDispatch
3084
+ } else {
3085
+ Get-ProjectBinaryCache $BuildPlatform Dispatch
3086
+ }
3087
+
3088
+ $FoundationBinaryCache = if ($BuildPlatform.DefaultSDK -match " Experimental" ) {
3089
+ Get-ProjectBinaryCache $BuildPlatform ExperimentalDynamicFoundation
3090
+ } else {
3091
+ Get-ProjectBinaryCache $BuildPlatform DynamicFoundation
3092
+ }
3070
3093
3071
- $RuntimeBinaryCache = Get-ProjectBinaryCache $BuildPlatform Runtime
3072
- $SwiftRuntimeDirectory = " ${RuntimeBinaryCache} \lib\swift "
3094
+ $env: Path = " $ ( Get-ProjectBinaryCache $BuildPlatform XCTest ) ; ${FoundationBinaryCache} \bin; ${DispatchBinaryCache} ; ${SwiftRuntime} \usr\bin; ${ env: Path} ; $UnixToolsBinDir "
3095
+ $env: SDKROOT = Get-SwiftSDK - OS $Platform .OS - Identifier $Platform .DefaultSDK
3073
3096
3074
3097
Build-CMakeProject `
3075
3098
- Src $SourceCache \swift- corelibs- xctest `
3076
3099
- Bin (Get-ProjectBinaryCache $BuildPlatform XCTest) `
3077
3100
- Platform $BuildPlatform `
3078
3101
- UseBuiltCompilers C, CXX, Swift `
3079
- - SwiftSDK $null `
3102
+ - SwiftSDK ( Get-SwiftSDK - OS $Platform .OS - Identifier $Platform .DefaultSDK ) `
3080
3103
- BuildTargets default , check- xctest `
3081
3104
- Defines @ {
3082
- CMAKE_Swift_FLAGS = @ (" -resource-dir" , $SwiftRuntimeDirectory , " -vfsoverlay" , " ${RuntimeBinaryCache} \stdlib\windows-vfs-overlay.yaml" );
3083
3105
ENABLE_TESTING = " YES" ;
3084
- dispatch_DIR = $ (Get-ProjectCMakeModules $BuildPlatform Dispatch);
3085
- Foundation_DIR = $ (Get-ProjectCMakeModules $BuildPlatform DynamicFoundation);
3086
3106
LLVM_DIR = " $ ( Get-ProjectBinaryCache $BuildPlatform LLVM) \lib\cmake\llvm" ;
3087
3107
XCTEST_PATH_TO_FOUNDATION_BUILD = $ (Get-ProjectBinaryCache $BuildPlatform DynamicFoundation);
3088
3108
XCTEST_PATH_TO_LIBDISPATCH_BUILD = $ (Get-ProjectBinaryCache $BuildPlatform Dispatch);
@@ -3098,12 +3118,10 @@ function Build-Testing([Hashtable] $Platform) {
3098
3118
- InstallTo " $ ( [IO.Path ]::Combine((Get-PlatformRoot $Platform.OS ), " Developer" , " Library" , " Testing-$ProductVersion " , " usr" )) " `
3099
3119
- Platform $Platform `
3100
3120
- UseBuiltCompilers CXX, Swift `
3101
- - SwiftSDK (Get-SwiftSDK $Platform.OS ) `
3121
+ - SwiftSDK (Get-SwiftSDK - OS $Platform.OS - Identifier $Platform .DefaultSDK ) `
3102
3122
- Defines @ {
3103
3123
BUILD_SHARED_LIBS = " YES" ;
3104
3124
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir ;
3105
- dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
3106
- Foundation_DIR = (Get-ProjectCMakeModules $Platform DynamicFoundation);
3107
3125
SwiftTesting_MACRO = " $ ( Get-ProjectBinaryCache $BuildPlatform BootstrapTestingMacros) \TestingMacros.dll" ;
3108
3126
SwiftTesting_INSTALL_NESTED_SUBDIR = " YES" ;
3109
3127
}
@@ -3164,8 +3182,6 @@ function Build-SDK([Hashtable] $Platform) {
3164
3182
Invoke-BuildStep Build-Dispatch $Platform
3165
3183
Invoke-BuildStep Build-Foundation $Platform
3166
3184
Invoke-BuildStep Build-CompilerRuntime $Platform
3167
- Invoke-BuildStep Build-XCTest $Platform
3168
- Invoke-BuildStep Build-Testing $Platform
3169
3185
}
3170
3186
3171
3187
function Build-ExperimentalSDK ([Hashtable ] $Platform ) {
@@ -4092,6 +4108,11 @@ if (-not $SkipBuild) {
4092
4108
}
4093
4109
}
4094
4110
4111
+ foreach ($Build in $WindowsSDKBuilds ) {
4112
+ Invoke-BuildStep Build-XCTest $Build
4113
+ Invoke-BuildStep Build-Testing $Build
4114
+ }
4115
+
4095
4116
Write-PlatformInfoPlist Windows
4096
4117
}
4097
4118
@@ -4145,6 +4166,11 @@ if (-not $SkipBuild) {
4145
4166
}
4146
4167
}
4147
4168
4169
+ foreach ($Build in $AndroidSDKBuilds ) {
4170
+ Invoke-BuildStep Build-XCTest $Build
4171
+ Invoke-BuildStep Build-Testing $Build
4172
+ }
4173
+
4148
4174
Write-PlatformInfoPlist Android
4149
4175
4150
4176
# Android swift-inspect only supports 64-bit platforms.
0 commit comments