@@ -55,6 +55,15 @@ let swiftPMDataModelProduct = (
55
55
]
56
56
)
57
57
58
+ let usePackageDependencies = ProcessInfo . processInfo. environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil
59
+
60
+ let swiftTestingDeps : [ Target . Dependency ]
61
+ if usePackageDependencies {
62
+ swiftTestingDeps = [ ]
63
+ } else {
64
+ swiftTestingDeps = [ . product( name: " Testing " , package : " swift-testing " ) ]
65
+ }
66
+
58
67
/** The `libSwiftPM` set of interfaces to programmatically work with Swift
59
68
packages. `libSwiftPM` includes all of the SwiftPM code except the
60
69
command line tools, while `libSwiftPMDataModel` includes only the data model.
@@ -733,7 +742,7 @@ let package = Package(
733
742
" XCBuildSupport " ,
734
743
" SwiftBuildSupport " ,
735
744
" _InternalTestSupport "
736
- ] ,
745
+ ] + swiftTestingDeps ,
737
746
swiftSettings: [
738
747
. unsafeFlags( [ " -static " ] ) ,
739
748
]
@@ -753,7 +762,7 @@ let package = Package(
753
762
. product( name: " TSCTestSupport " , package : " swift-tools-support-core " ) ,
754
763
. product( name: " OrderedCollections " , package : " swift-collections " ) ,
755
764
" Workspace " ,
756
- ] ,
765
+ ] + swiftTestingDeps ,
757
766
swiftSettings: [
758
767
. unsafeFlags( [ " -static " ] ) ,
759
768
]
@@ -998,7 +1007,7 @@ func swiftSyntaxDependencies(_ names: [String]) -> [Target.Dependency] {
998
1007
let relatedDependenciesBranch = " main "
999
1008
1000
1009
if ProcessInfo . processInfo. environment [ " SWIFTPM_LLBUILD_FWK " ] == nil {
1001
- if ProcessInfo . processInfo . environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil {
1010
+ if usePackageDependencies {
1002
1011
package . dependencies += [
1003
1012
. package ( url: " https://github.com/swiftlang/swift-llbuild.git " , branch: relatedDependenciesBranch) ,
1004
1013
]
@@ -1014,7 +1023,7 @@ if ProcessInfo.processInfo.environment["SWIFTPM_LLBUILD_FWK"] == nil {
1014
1023
]
1015
1024
}
1016
1025
1017
- if ProcessInfo . processInfo . environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil {
1026
+ if usePackageDependencies {
1018
1027
package . dependencies += [
1019
1028
. package ( url: " https://github.com/swiftlang/swift-tools-support-core.git " , branch: relatedDependenciesBranch) ,
1020
1029
// The 'swift-argument-parser' version declared here must match that
@@ -1040,6 +1049,7 @@ if ProcessInfo.processInfo.environment["SWIFTCI_USE_LOCAL_DEPS"] == nil {
1040
1049
. package ( path: " ../swift-collections " ) ,
1041
1050
. package ( path: " ../swift-certificates " ) ,
1042
1051
. package ( path: " ../swift-toolchain-sqlite " ) ,
1052
+ . package ( path: " ../swift-testing " ) ,
1043
1053
]
1044
1054
}
1045
1055
@@ -1063,7 +1073,7 @@ if ProcessInfo.processInfo.environment["SWIFTPM_SWBUILD_FRAMEWORK"] == nil &&
1063
1073
. product( name: " SWBBuildService " , package : " swift-build " ) ,
1064
1074
]
1065
1075
1066
- if ProcessInfo . processInfo . environment [ " SWIFTCI_USE_LOCAL_DEPS " ] == nil {
1076
+ if usePackageDependencies {
1067
1077
package . dependencies += [
1068
1078
. package ( url: " https://github.com/swiftlang/swift-build.git " , branch: relatedDependenciesBranch) ,
1069
1079
]
0 commit comments