Skip to content

Commit d711bb7

Browse files
Module dependencies fixit should append instead of prepend new insertions to xcconfigs (rdar://156174282)
1 parent 5aab44a commit d711bb7

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

Sources/SWBCore/Dependencies.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -205,10 +205,10 @@ public struct ModuleDependenciesContext: Sendable, SerializableCodable {
205205
self.init(sourceRange: .init(path: location.path, startLine: location.endLine, startColumn: location.endColumn, endLine: location.endLine, endColumn: location.endColumn), modificationStyle: .appendToExistingAssignment)
206206
}
207207
else if let path = settings.constructionComponents.targetXcconfigPath {
208-
self.init(sourceRange: .init(path: path, startLine: 0, startColumn: 0, endLine: 0, endColumn: 0), modificationStyle: .insertNewAssignment(targetNameCondition: nil))
208+
self.init(sourceRange: .init(path: path, startLine: .max, startColumn: .max, endLine: .max, endColumn: .max), modificationStyle: .insertNewAssignment(targetNameCondition: nil))
209209
}
210210
else if let path = settings.constructionComponents.projectXcconfigPath {
211-
self.init(sourceRange: .init(path: path, startLine: 0, startColumn: 0, endLine: 0, endColumn: 0), modificationStyle: .insertNewAssignment(targetNameCondition: target.name))
211+
self.init(sourceRange: .init(path: path, startLine: .max, startColumn: .max, endLine: .max, endColumn: .max), modificationStyle: .insertNewAssignment(targetNameCondition: target.name))
212212
}
213213
else {
214214
return nil

Tests/SWBBuildSystemTests/DependencyValidationTests.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -420,11 +420,11 @@ fileprivate struct DependencyValidationTests: CoreBasedTests {
420420
"TargetB": [
421421
Diagnostic(
422422
behavior: .error,
423-
location: Diagnostic.Location.path(projectXCConfigPath, line: 0, column: 0),
423+
location: Diagnostic.Location.path(projectXCConfigPath, line: .max, column: .max),
424424
data: DiagnosticData("Missing entries in MODULE_DEPENDENCIES: Foundation"),
425425
fixIts: [
426426
Diagnostic.FixIt(
427-
sourceRange: Diagnostic.SourceRange(path: projectXCConfigPath, startLine: 0, startColumn: 0, endLine: 0, endColumn: 0),
427+
sourceRange: Diagnostic.SourceRange(path: projectXCConfigPath, startLine: .max, startColumn: .max, endLine: .max, endColumn: .max),
428428
newText: "\nMODULE_DEPENDENCIES[target=TargetB] = $(inherited) Foundation\n"),
429429
],
430430
childDiagnostics: [
@@ -433,7 +433,7 @@ fileprivate struct DependencyValidationTests: CoreBasedTests {
433433
location: Diagnostic.Location.path(swiftSourcePath, line: 1, column: 8),
434434
data: DiagnosticData("Missing entry in MODULE_DEPENDENCIES: Foundation"),
435435
fixIts: [Diagnostic.FixIt(
436-
sourceRange: Diagnostic.SourceRange(path: projectXCConfigPath, startLine: 0, startColumn: 0, endLine: 0, endColumn: 0),
436+
sourceRange: Diagnostic.SourceRange(path: projectXCConfigPath, startLine: .max, startColumn: .max, endLine: .max, endColumn: .max),
437437
newText: "\nMODULE_DEPENDENCIES[target=TargetB] = $(inherited) Foundation\n")],
438438
),
439439
]),

0 commit comments

Comments
 (0)