@@ -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
@@ -3105,36 +3114,47 @@ function Build-XCTest([Hashtable] $Platform) {
3105
3114
- InstallTo " $ ( [IO.Path ]::Combine((Get-PlatformRoot $Platform.OS ), " Developer" , " Library" , " XCTest-$ProductVersion " , " usr" )) " `
3106
3115
- Platform $Platform `
3107
3116
- UseBuiltCompilers Swift `
3108
- - SwiftSDK (Get-SwiftSDK $Platform.OS ) `
3117
+ - SwiftSDK (Get-SwiftSDK - OS $Platform.OS - Identifier $Platform .DefaultSDK ) `
3109
3118
- Defines @ {
3110
3119
BUILD_SHARED_LIBS = " YES" ;
3111
3120
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir ;
3112
3121
ENABLE_TESTING = " NO" ;
3113
- dispatch_DIR = $ (Get-ProjectCMakeModules $Platform Dispatch);
3114
- Foundation_DIR = $ (Get-ProjectCMakeModules $Platform DynamicFoundation);
3115
3122
XCTest_INSTALL_NESTED_SUBDIR = " YES" ;
3116
3123
}
3117
3124
}
3118
3125
3119
3126
function Test-XCTest {
3120
3127
Invoke-IsolatingEnvVars {
3121
- $env: Path = " $ ( Get-ProjectBinaryCache $BuildPlatform XCTest) ;$ ( Get-ProjectBinaryCache $BuildPlatform DynamicFoundation) \bin;$ ( Get-ProjectBinaryCache $BuildPlatform Dispatch) ;$ ( Get-ProjectBinaryCache $BuildPlatform Runtime) \bin;${env: Path} ;$UnixToolsBinDir "
3128
+ $SwiftRuntime = if ($BuildPlatform.DefaultSDK -match " Experimental" ) {
3129
+ [IO.Path ]::Combine((Get-InstallDir $BuildPlatform ), " Runtimes" , " $ProductVersion .experimental" );
3130
+ } else {
3131
+ [IO.Path ]::Combine((Get-InstallDir $BuildPlatform ), " Runtimes" , " $ProductVersion " );
3132
+ }
3133
+
3134
+ $DispatchBinaryCache = if ($BuildPlatform.DefaultSDK -match " Experimental" ) {
3135
+ Get-ProjectBinaryCache $BuildPlatform ExperimentalDynamicDispatch
3136
+ } else {
3137
+ Get-ProjectBinaryCache $BuildPlatform Dispatch
3138
+ }
3139
+
3140
+ $FoundationBinaryCache = if ($BuildPlatform.DefaultSDK -match " Experimental" ) {
3141
+ Get-ProjectBinaryCache $BuildPlatform ExperimentalDynamicFoundation
3142
+ } else {
3143
+ Get-ProjectBinaryCache $BuildPlatform DynamicFoundation
3144
+ }
3122
3145
3123
- $RuntimeBinaryCache = Get-ProjectBinaryCache $BuildPlatform Runtime
3124
- $SwiftRuntimeDirectory = " ${RuntimeBinaryCache} \lib\swift "
3146
+ $env: Path = " $ ( Get-ProjectBinaryCache $BuildPlatform XCTest ) ; ${FoundationBinaryCache} \bin; ${DispatchBinaryCache} ; ${SwiftRuntime} \usr\bin; ${ env: Path} ; $UnixToolsBinDir "
3147
+ $env: SDKROOT = Get-SwiftSDK - OS $Platform .OS - Identifier $Platform .DefaultSDK
3125
3148
3126
3149
Build-CMakeProject `
3127
3150
- Src $SourceCache \swift- corelibs- xctest `
3128
3151
- Bin (Get-ProjectBinaryCache $BuildPlatform XCTest) `
3129
3152
- Platform $BuildPlatform `
3130
3153
- UseBuiltCompilers C, CXX, Swift `
3131
- - SwiftSDK $null `
3154
+ - SwiftSDK ( Get-SwiftSDK - OS $Platform .OS - Identifier $Platform .DefaultSDK ) `
3132
3155
- BuildTargets default , check- xctest `
3133
3156
- Defines @ {
3134
- CMAKE_Swift_FLAGS = @ (" -resource-dir" , $SwiftRuntimeDirectory , " -vfsoverlay" , " ${RuntimeBinaryCache} \stdlib\windows-vfs-overlay.yaml" );
3135
3157
ENABLE_TESTING = " YES" ;
3136
- dispatch_DIR = $ (Get-ProjectCMakeModules $BuildPlatform Dispatch);
3137
- Foundation_DIR = $ (Get-ProjectCMakeModules $BuildPlatform DynamicFoundation);
3138
3158
LLVM_DIR = " $ ( Get-ProjectBinaryCache $BuildPlatform LLVM) \lib\cmake\llvm" ;
3139
3159
XCTEST_PATH_TO_FOUNDATION_BUILD = $ (Get-ProjectBinaryCache $BuildPlatform DynamicFoundation);
3140
3160
XCTEST_PATH_TO_LIBDISPATCH_BUILD = $ (Get-ProjectBinaryCache $BuildPlatform Dispatch);
@@ -3150,12 +3170,10 @@ function Build-Testing([Hashtable] $Platform) {
3150
3170
- InstallTo " $ ( [IO.Path ]::Combine((Get-PlatformRoot $Platform.OS ), " Developer" , " Library" , " Testing-$ProductVersion " , " usr" )) " `
3151
3171
- Platform $Platform `
3152
3172
- UseBuiltCompilers CXX, Swift `
3153
- - SwiftSDK (Get-SwiftSDK $Platform.OS ) `
3173
+ - SwiftSDK (Get-SwiftSDK - OS $Platform.OS - Identifier $Platform .DefaultSDK ) `
3154
3174
- Defines @ {
3155
3175
BUILD_SHARED_LIBS = " YES" ;
3156
3176
CMAKE_INSTALL_BINDIR = $Platform.BinaryDir ;
3157
- dispatch_DIR = (Get-ProjectCMakeModules $Platform Dispatch);
3158
- Foundation_DIR = (Get-ProjectCMakeModules $Platform DynamicFoundation);
3159
3177
SwiftTesting_MACRO = " $ ( Get-ProjectBinaryCache $BuildPlatform BootstrapTestingMacros) \TestingMacros.dll" ;
3160
3178
SwiftTesting_INSTALL_NESTED_SUBDIR = " YES" ;
3161
3179
}
@@ -3216,8 +3234,6 @@ function Build-SDK([Hashtable] $Platform) {
3216
3234
Invoke-BuildStep Build-Dispatch $Platform
3217
3235
Invoke-BuildStep Build-Foundation $Platform
3218
3236
Invoke-BuildStep Build-CompilerRuntime $Platform
3219
- Invoke-BuildStep Build-XCTest $Platform
3220
- Invoke-BuildStep Build-Testing $Platform
3221
3237
}
3222
3238
3223
3239
function Build-ExperimentalSDK ([Hashtable ] $Platform ) {
@@ -4144,6 +4160,11 @@ if (-not $SkipBuild) {
4144
4160
}
4145
4161
}
4146
4162
4163
+ foreach ($Build in $WindowsSDKBuilds ) {
4164
+ Invoke-BuildStep Build-XCTest $Build
4165
+ Invoke-BuildStep Build-Testing $Build
4166
+ }
4167
+
4147
4168
Write-PlatformInfoPlist Windows
4148
4169
}
4149
4170
@@ -4197,6 +4218,11 @@ if (-not $SkipBuild) {
4197
4218
}
4198
4219
}
4199
4220
4221
+ foreach ($Build in $AndroidSDKBuilds ) {
4222
+ Invoke-BuildStep Build-XCTest $Build
4223
+ Invoke-BuildStep Build-Testing $Build
4224
+ }
4225
+
4200
4226
Write-PlatformInfoPlist Android
4201
4227
4202
4228
# Android swift-inspect only supports 64-bit platforms.
0 commit comments