@@ -186,12 +186,8 @@ public final class SwiftModuleDependencyGraph: SwiftGlobalExplicitDependencyGrap
186
186
187
187
/// Get the CASDatabases from the casOptions
188
188
public func getCASDatabases( casOptions: CASOptions ? , compilerLocation: LibSwiftDriver . CompilerLocation ) throws -> SwiftCASDatabases ? {
189
- #if canImport(SwiftDriver, _version: "1.103.1")
190
189
guard let casOpts = casOptions else { return nil }
191
190
return try createCASDatabases ( casOptions: casOpts, compilerLocation: compilerLocation)
192
- #else
193
- return nil
194
- #endif
195
191
}
196
192
197
193
private func register( key: String , driver: LibSwiftDriver ) {
@@ -467,13 +463,11 @@ public final class LibSwiftDriver {
467
463
let key = SwiftModuleDependencyGraph . OracleRegistryKey ( compilerLocation: compilerLocation, casOpts: casOptions)
468
464
let oracle = graph? . oracleRegistry. getOrInsert ( key, { InterModuleDependencyOracle ( ) } )
469
465
self . driver = try Driver ( args: commandLine, env: env, diagnosticsOutput: . engine( diagnosticsEngine) , executor: executor, compilerExecutableDir: compilerExecutableDir, interModuleDependencyOracle: oracle)
470
- #if canImport(SwiftDriver, _version: "1.103.1")
471
466
if let scanOracle = oracle, let scanLib = try driver. getSwiftScanLibPath ( ) {
472
467
// Errors instantiating the scanner are potentially recoverable, so suppress them here. Truly fatal errors
473
468
// will be diagnosed later.
474
469
try ? scanOracle. verifyOrCreateScannerInstance ( swiftScanLibPath: scanLib)
475
470
}
476
- #endif
477
471
}
478
472
479
473
private func run( dryRun: Bool = false ) -> ( success: Bool , diagnostics: [ SWBUtil . Diagnostic ] , jobs: [ Job ] ) {
@@ -585,7 +579,6 @@ extension LibSwiftDriver {
585
579
586
580
// MARK: Wrappers for SwiftDriver CAS types
587
581
588
- #if canImport(SwiftDriver, _version: "1.103.1")
589
582
extension SwiftModuleDependencyGraph {
590
583
/// Create the CASDatabases from CASOptions
591
584
private func createCASDatabases( casOptions: CASOptions , compilerLocation: LibSwiftDriver . CompilerLocation ) throws -> SwiftCASDatabases {
@@ -713,62 +706,15 @@ public final class SwiftCASDatabases {
713
706
return try await cas. download ( with: id)
714
707
}
715
708
}
716
- #else
717
- public final class SwiftCachedCompilation {
718
- public func getOutputs( ) throws -> [ SwiftCachedOutput ] {
719
- return [ ]
720
- }
721
- public func makeGlobal( ) async throws { }
722
-
723
- public func makeGlobal( _ callback: @escaping ( Swift . Error ? ) -> Void ) { }
724
- }
725
- public final class SwiftCachedOutput {
726
- public let casID : String = " "
727
- public let kindName : String = " "
728
- public let isMaterialized : Bool = false
729
- }
730
- public final class SwiftCacheReplayInstance { }
731
- public final class SwiftCacheReplayResult {
732
- public func getStdOut( ) throws -> String {
733
- return " "
734
- }
735
- public func getStdErr( ) throws -> String {
736
- return " "
737
- }
738
- }
739
- public final class SwiftCASDatabases {
740
- public func queryCacheKey( _ key: String , globally: Bool ) async throws -> SwiftCachedCompilation ? {
741
- return nil
742
- }
743
- public func queryLocalCacheKey( _ key: String ) throws -> SwiftCachedCompilation ? {
744
- return nil
745
- }
746
-
747
- public func createReplayInstance( cmd: [ String ] ) throws -> SwiftCacheReplayInstance {
748
- return SwiftCacheReplayInstance ( )
749
- }
750
-
751
- public func replayCompilation( instance: SwiftCacheReplayInstance , compilation: SwiftCachedCompilation ) throws -> SwiftCacheReplayResult {
752
- return SwiftCacheReplayResult ( )
753
- }
754
- public func download( with id: String ) async throws -> Bool {
755
- return true
756
- }
757
- }
758
- #endif
759
709
760
710
extension SWBUtil . Diagnostic {
761
711
fileprivate static func build( from other: TSCBasic . Diagnostic ) -> Self {
762
712
let location : SWBUtil . Diagnostic . Location
763
- #if canImport(SwiftDriver, _version: 1.111)
764
713
if let scannerLocation = other. location as? ScannerDiagnosticSourceLocation {
765
714
location = . path( Path ( scannerLocation. bufferIdentifier) , line: scannerLocation. lineNumber, column: scannerLocation. columnNumber)
766
715
} else {
767
716
location = . unknown
768
717
}
769
- #else
770
- location = . unknown
771
- #endif
772
718
return SWBUtil . Diagnostic ( behavior: . build( from: other. behavior) , location: location, data: DiagnosticData ( other. message. text, component: . swiftCompilerError) )
773
719
}
774
720
}
0 commit comments