@@ -20,6 +20,17 @@ let appleOS = true
20
20
let appleOS = false
21
21
#endif
22
22
23
+ // Workaround until FreeBSD platform condition lands
24
+ #if os(FreeBSD)
25
+ let nonApplePlatformsCondition : TargetDependencyCondition ? = nil
26
+ let nonAppleUnixPlatformsCondition : TargetDependencyCondition ? = nil
27
+ let noCustomExecutionTraitCondition : BuildSettingCondition ? = nil
28
+ #else
29
+ let nonApplePlatformsCondition : TargetDependencyCondition ? = . when( platforms: [ . linux, . openbsd, . android, . windows] )
30
+ let nonAppleUnixPlatformsCondition : TargetDependencyCondition ? = . when( platforms: [ . linux, . openbsd, . android] )
31
+ let noCustomExecutionTraitCondition : BuildSettingCondition ? = . when( platforms: [ . macOS, . macCatalyst, . iOS, . tvOS, . watchOS, . visionOS, . windows] )
32
+ #endif
33
+
23
34
let useLocalDependencies = Context . environment [ " SWIFTCI_USE_LOCAL_DEPS " ] != nil
24
35
let useLLBuildFramework = Context . environment [ " SWIFTBUILD_LLBUILD_FWK " ] != nil
25
36
let readlinePackage = !appleOS ? " readline " : nil
@@ -82,7 +93,7 @@ let package = Package(
82
93
" SWBBuildSystem " ,
83
94
" SWBServiceCore " ,
84
95
" SWBTaskExecution " ,
85
- . product( name: " SystemPackage " , package : " swift-system " , condition: . when ( platforms : [ . linux , . android , . windows ] ) ) ,
96
+ . product( name: " SystemPackage " , package : " swift-system " , condition: nonApplePlatformsCondition ) ,
86
97
] ,
87
98
swiftSettings: swiftSettings) ,
88
99
. target(
@@ -164,8 +175,8 @@ let package = Package(
164
175
" SWBLibc " ,
165
176
. target( name: " readline " , condition: . when( platforms: [ . linux] ) ) ,
166
177
. product( name: " ArgumentParser " , package : " swift-argument-parser " ) ,
167
- . product( name: " Crypto " , package : " swift-crypto " , condition: . when ( platforms : [ . linux , . android ] ) ) ,
168
- . product( name: " SystemPackage " , package : " swift-system " , condition: . when ( platforms : [ . linux , . android , . windows ] ) ) ,
178
+ . product( name: " Crypto " , package : " swift-crypto " , condition: nonAppleUnixPlatformsCondition ) ,
179
+ . product( name: " SystemPackage " , package : " swift-system " , condition: nonApplePlatformsCondition ) ,
169
180
] ,
170
181
swiftSettings: swiftSettings) ,
171
182
. target(
@@ -210,20 +221,20 @@ let package = Package(
210
221
// Test support
211
222
. target(
212
223
name: " SwiftBuildTestSupport " ,
213
- dependencies: [ " SwiftBuild " , " SWBTestSupport " , " SWBUtil " ] ,
224
+ dependencies: [ " SwiftBuild " , " SWBTestSupport " , " SWBUtil " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
214
225
swiftSettings: swiftSettings,
215
226
linkerSettings: [
216
227
. linkedFramework( " Testing " , . when( platforms: [ . macOS] ) )
217
228
] ) ,
218
229
. target(
219
230
name: " SWBTestSupport " ,
220
- dependencies: [ " SwiftBuild " , " SWBBuildSystem " , " SWBCore " , " SWBTaskConstruction " , " SWBTaskExecution " , " SWBUtil " , " SWBLLBuild " , " SWBMacro " ] ,
231
+ dependencies: [ " SwiftBuild " , " SWBBuildSystem " , " SWBCore " , " SWBTaskConstruction " , " SWBTaskExecution " , " SWBUtil " , " SWBLLBuild " , " SWBMacro " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
221
232
swiftSettings: swiftSettings + [
222
233
// Temporary until swift-testing introduces replacement for this SPI
223
- . define( " DONT_HAVE_CUSTOM_EXECUTION_TRAIT " , . when ( platforms : [ . macOS , . macCatalyst , . iOS , . tvOS , . watchOS , . visionOS , . windows ] ) )
234
+ . define( " DONT_HAVE_CUSTOM_EXECUTION_TRAIT " , noCustomExecutionTraitCondition )
224
235
] ,
225
236
linkerSettings: [
226
- . linkedFramework( " Testing " , . when( platforms: [ . macOS] ) )
237
+ . linkedFramework( " Testing " , . when( platforms: [ . macOS] ) ) ,
227
238
] ) ,
228
239
229
240
// Tests
@@ -260,11 +271,11 @@ let package = Package(
260
271
swiftSettings: swiftSettings) ,
261
272
. testTarget(
262
273
name: " SWBProjectModelTests " ,
263
- dependencies: [ " SWBProjectModel " ] ,
274
+ dependencies: [ " SWBProjectModel " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
264
275
swiftSettings: swiftSettings) ,
265
276
. testTarget(
266
277
name: " SWBProtocolTests " ,
267
- dependencies: [ " SWBProtocol " , " SWBUtil " ] ,
278
+ dependencies: [ " SWBProtocol " , " SWBUtil " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
268
279
swiftSettings: swiftSettings) ,
269
280
. testTarget(
270
281
name: " SWBUtilTests " ,
@@ -280,7 +291,7 @@ let package = Package(
280
291
swiftSettings: swiftSettings) ,
281
292
. testTarget(
282
293
name: " SWBServiceCoreTests " ,
283
- dependencies: [ " SWBServiceCore " ] ,
294
+ dependencies: [ " SWBServiceCore " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
284
295
swiftSettings: swiftSettings) ,
285
296
. testTarget(
286
297
name: " SWBCoreTests " ,
@@ -401,15 +412,32 @@ if useLocalDependencies {
401
412
package . dependencies += [ . package ( path: " ../llbuild " ) , ]
402
413
}
403
414
} else {
415
+ #if os(FreeBSD)
416
+ package . dependencies += [
417
+ // https://github.com/apple/swift-crypto/commit/bce1725222a0547c061fb71eab460aff1aa1e28b is not yet in a tag
418
+ . package ( url: " https://github.com/apple/swift-crypto.git " , branch: " main " ) ,
419
+
420
+ // https://github.com/apple/swift-system/commit/4fa2a719c5d225fc763f21f2d341c0c8d825d65e is not yet in a tag
421
+ . package ( url: " https://github.com/apple/swift-system.git " , branch: " main " ) ,
422
+ ]
423
+ #else
404
424
package . dependencies += [
405
425
// https://github.com/apple/swift-crypto/issues/262
406
426
// 3.7.1 introduced a regression which fails to link on aarch64-windows; revert to <4.0.0 for the upper bound when this is fixed
407
427
. package ( url: " https://github.com/apple/swift-crypto.git " , " 2.0.0 " ..< " 3.7.1 " ) ,
408
- . package ( url : " https://github.com/apple/swift-driver.git " , branch : " main " ) ,
428
+
409
429
. package ( url: " https://github.com/apple/swift-system.git " , . upToNextMajor( from: " 1.4.0 " ) ) ,
430
+ ]
431
+ #endif
432
+
433
+ package . dependencies += [
434
+ . package ( url: " https://github.com/apple/swift-driver.git " , branch: " main " ) ,
410
435
. package ( url: " https://github.com/apple/swift-argument-parser.git " , from: " 1.0.3 " ) ,
411
436
]
412
437
if !useLLBuildFramework {
413
438
package . dependencies += [ . package ( url: " https://github.com/apple/swift-llbuild.git " , branch: " main " ) , ]
414
439
}
415
440
}
441
+
442
+
443
+ package . dependencies += [ . package ( url: " https://github.com/swiftlang/swift-testing " , branch: " main " ) ]
0 commit comments