@@ -20,6 +20,17 @@ let appleOS = true
2020let appleOS = false
2121#endif
2222
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+
2334let useLocalDependencies = Context . environment [ " SWIFTCI_USE_LOCAL_DEPS " ] != nil
2435let useLLBuildFramework = Context . environment [ " SWIFTBUILD_LLBUILD_FWK " ] != nil
2536let readlinePackage = !appleOS ? " readline " : nil
@@ -82,7 +93,7 @@ let package = Package(
8293 " SWBBuildSystem " ,
8394 " SWBServiceCore " ,
8495 " SWBTaskExecution " ,
85- . product( name: " SystemPackage " , package : " swift-system " , condition: . when ( platforms : [ . linux , . android , . windows ] ) ) ,
96+ . product( name: " SystemPackage " , package : " swift-system " , condition: nonApplePlatformsCondition ) ,
8697 ] ,
8798 swiftSettings: swiftSettings) ,
8899 . target(
@@ -164,8 +175,8 @@ let package = Package(
164175 " SWBLibc " ,
165176 . target( name: " readline " , condition: . when( platforms: [ . linux] ) ) ,
166177 . 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 ) ,
169180 ] ,
170181 swiftSettings: swiftSettings) ,
171182 . target(
@@ -210,20 +221,20 @@ let package = Package(
210221 // Test support
211222 . target(
212223 name: " SwiftBuildTestSupport " ,
213- dependencies: [ " SwiftBuild " , " SWBTestSupport " , " SWBUtil " ] ,
224+ dependencies: [ " SwiftBuild " , " SWBTestSupport " , " SWBUtil " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
214225 swiftSettings: swiftSettings,
215226 linkerSettings: [
216227 . linkedFramework( " Testing " , . when( platforms: [ . macOS] ) )
217228 ] ) ,
218229 . target(
219230 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 " ) ] ,
221232 swiftSettings: swiftSettings + [
222233 // 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 )
224235 ] ,
225236 linkerSettings: [
226- . linkedFramework( " Testing " , . when( platforms: [ . macOS] ) )
237+ . linkedFramework( " Testing " , . when( platforms: [ . macOS] ) ) ,
227238 ] ) ,
228239
229240 // Tests
@@ -260,11 +271,11 @@ let package = Package(
260271 swiftSettings: swiftSettings) ,
261272 . testTarget(
262273 name: " SWBProjectModelTests " ,
263- dependencies: [ " SWBProjectModel " ] ,
274+ dependencies: [ " SWBProjectModel " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
264275 swiftSettings: swiftSettings) ,
265276 . testTarget(
266277 name: " SWBProtocolTests " ,
267- dependencies: [ " SWBProtocol " , " SWBUtil " ] ,
278+ dependencies: [ " SWBProtocol " , " SWBUtil " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
268279 swiftSettings: swiftSettings) ,
269280 . testTarget(
270281 name: " SWBUtilTests " ,
@@ -280,7 +291,7 @@ let package = Package(
280291 swiftSettings: swiftSettings) ,
281292 . testTarget(
282293 name: " SWBServiceCoreTests " ,
283- dependencies: [ " SWBServiceCore " ] ,
294+ dependencies: [ " SWBServiceCore " , . product ( name : " Testing " , package : " swift-testing " ) ] ,
284295 swiftSettings: swiftSettings) ,
285296 . testTarget(
286297 name: " SWBCoreTests " ,
@@ -401,15 +412,32 @@ if useLocalDependencies {
401412 package . dependencies += [ . package ( path: " ../llbuild " ) , ]
402413 }
403414} 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
404424 package . dependencies += [
405425 // https://github.com/apple/swift-crypto/issues/262
406426 // 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
407427 . 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+
409429 . 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 " ) ,
410435 . package ( url: " https://github.com/apple/swift-argument-parser.git " , from: " 1.0.3 " ) ,
411436 ]
412437 if !useLLBuildFramework {
413438 package . dependencies += [ . package ( url: " https://github.com/apple/swift-llbuild.git " , branch: " main " ) , ]
414439 }
415440}
441+
442+
443+ package . dependencies += [ . package ( url: " https://github.com/swiftlang/swift-testing " , branch: " main " ) ]
0 commit comments