File tree Expand file tree Collapse file tree 4 files changed +22
-2
lines changed
Sources/SKSwiftPMWorkspace Expand file tree Collapse file tree 4 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -374,6 +374,9 @@ extension SwiftPMBuildSystem: SKCore.BuildSystem {
374
374
private func compilerArguments( for file: URL , in buildTarget: any SwiftBuildTarget ) async throws -> [ String ] {
375
375
let compileArguments = try buildTarget. compileArguments ( for: file)
376
376
377
+ #if compiler(>=6.1)
378
+ #warning("When we drop support for Swift 5.10 we no longer need to adjust compiler arguments for the Modules move")
379
+ #endif
377
380
// Fix up compiler arguments that point to a `/Modules` subdirectory if the Swift version in the toolchain is less
378
381
// than 6.0 because it places the modules one level higher up.
379
382
let toolchainVersion = await orLog ( " Getting Swift version " ) { try await toolchainRegistry. default? . swiftVersion }
Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ final class DependencyTrackingTests: XCTestCase {
50
50
// Semantic analysis: expect module import error.
51
51
XCTAssertEqual ( initialDiags. diagnostics. count, 1 )
52
52
if let diagnostic = initialDiags. diagnostics. first {
53
+ #if compiler(>=6.1)
54
+ #warning("When we drop support for Swift 5.10 we no longer need to check for the Objective-C error message")
55
+ #endif
53
56
XCTAssert (
54
57
diagnostic. message. contains ( " Could not build Objective-C module " )
55
58
|| diagnostic. message. contains ( " No such module " ) ,
Original file line number Diff line number Diff line change @@ -186,7 +186,14 @@ final class PublishDiagnosticsTests: XCTestCase {
186
186
187
187
_ = try project. openDocument ( " LibB.swift " )
188
188
let diagnosticsBeforeBuilding = try await project. testClient. nextDiagnosticsNotification ( )
189
- XCTAssert ( diagnosticsBeforeBuilding. diagnostics. contains ( where: { $0. message == " No such module 'LibA' " } ) )
189
+ XCTAssert (
190
+ diagnosticsBeforeBuilding. diagnostics. contains ( where: {
191
+ #if compiler(>=6.1)
192
+ #warning("When we drop support for Swift 5.10 we no longer need to check for the Objective-C error message")
193
+ #endif
194
+ return $0. message == " No such module 'LibA' " || $0. message == " Could not build Objective-C module 'LibA' "
195
+ } )
196
+ )
190
197
191
198
try await SwiftPMTestProject . build ( at: project. scratchDirectory)
192
199
Original file line number Diff line number Diff line change @@ -222,7 +222,14 @@ final class PullDiagnosticsTests: XCTestCase {
222
222
XCTFail ( " Expected full diagnostics report " )
223
223
return
224
224
}
225
- XCTAssert ( fullReportBeforeBuilding. items. contains ( where: { $0. message == " No such module 'LibA' " } ) )
225
+ XCTAssert (
226
+ fullReportBeforeBuilding. items. contains ( where: {
227
+ #if compiler(>=6.1)
228
+ #warning("When we drop support for Swift 5.10 we no longer need to check for the Objective-C error message")
229
+ #endif
230
+ return $0. message == " No such module 'LibA' " || $0. message == " Could not build Objective-C module 'LibA' "
231
+ } )
232
+ )
226
233
227
234
let diagnosticsRefreshRequestReceived = self . expectation ( description: " DiagnosticsRefreshRequest received " )
228
235
project. testClient. handleSingleRequest { ( request: DiagnosticsRefreshRequest ) in
You can’t perform that action at this time.
0 commit comments