@@ -322,7 +322,7 @@ fileprivate func setup(
322
322
#else
323
323
try Process . checkNonZeroExit ( args: " cp " , " -R " , " -H " , srcDir. pathString, dstDir. pathString)
324
324
#endif
325
-
325
+
326
326
// Ensure we get a clean test fixture.
327
327
try localFileSystem. removeFileTree ( dstDir. appending ( component: " .build " ) )
328
328
try localFileSystem. removeFileTree ( dstDir. appending ( component: " .swiftpm " ) )
@@ -533,14 +533,7 @@ private func swiftArgs(
533
533
Xswiftc: [ String] ,
534
534
buildSystem: BuildSystemProvider . Kind?
535
535
) - > [ String] {
536
- var args = [ " --configuration " ]
537
- switch configuration {
538
- case . debug:
539
- args. append ( " debug " )
540
- case . release:
541
- args. append ( " release " )
542
- }
543
-
536
+ var args = configuration. buildArgs
544
537
args += Xcc . flatMap { [ " -Xcc " , $0] }
545
538
args += Xld . flatMap { [ " -Xlinker " , $0] }
546
539
args += Xswiftc . flatMap { [ " -Xswiftc " , $0] }
@@ -549,7 +542,7 @@ private func swiftArgs(
549
542
return args
550
543
}
551
544
552
- @available( * ,
545
+ @available( * ,
553
546
deprecated,
554
547
renamed: " loadModulesGraph " ,
555
548
message: " Rename for consistency: the type of this functions return value is named `ModulesGraph`. "
@@ -582,6 +575,19 @@ public func loadPackageGraph(
582
575
)
583
576
}
584
577
578
+ extension BuildConfiguration {
579
+ public var buildArgs: [ String ] {
580
+ var args = [ " --configuration " ]
581
+ switch self {
582
+ case . debug:
583
+ args. append ( " debug " )
584
+ case . release:
585
+ args. append ( " release " )
586
+ }
587
+ return args
588
+ }
589
+ }
590
+
585
591
public let emptyZipFile = ByteString ( [ 0x80 , 0x75 , 0x05 , 0x06 ] + [ UInt8] ( repeating: 0x00 , count: 18 ) )
586
592
587
593
extension FileSystem {
@@ -693,7 +699,7 @@ public func getNumberOfMatches(of match: String, in value: String) -> Int {
693
699
}
694
700
695
701
public extension String {
696
- var withSwiftLineEnding : String {
702
+ var withSwiftLineEnding : String {
697
703
return replacingOccurrences ( of: " \r \n " , with: " \n " )
698
704
}
699
705
}
0 commit comments