diff --git a/CHANGELOG.md b/CHANGELOG.md index cef7eeb5..ef6b8435 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ - Added support for shared breakpoints #177 @alexruperez @myihsan +### Fixed + +- Fix case where source paths may not be deduplicated correctly resulting in duplicate groups and/or a crash in running Xcodegen #1341 @dalemyers + ## 2.34.0 ### Changed diff --git a/Sources/ProjectSpec/TargetSource.swift b/Sources/ProjectSpec/TargetSource.swift index 7ad5e4aa..6674972b 100644 --- a/Sources/ProjectSpec/TargetSource.swift +++ b/Sources/ProjectSpec/TargetSource.swift @@ -4,8 +4,13 @@ import PathKit public struct TargetSource: Equatable { public static let optionalDefault = false - - public var path: String + + public var path: String { + didSet { + path = (path as NSString).standardizingPath + } + } + public var name: String? public var group: String? public var compilerFlags: [String] @@ -48,7 +53,7 @@ public struct TargetSource: Equatable { attributes: [String] = [], resourceTags: [String] = [] ) { - self.path = path + self.path = (path as NSString).standardizingPath self.name = name self.group = group self.compilerFlags = compilerFlags @@ -83,6 +88,7 @@ extension TargetSource: JSONObjectConvertible { public init(jsonDictionary: JSONDictionary) throws { path = try jsonDictionary.json(atKeyPath: "path") + path = (path as NSString).standardizingPath // Done in two steps as the compiler can't figure out the types otherwise name = jsonDictionary.json(atKeyPath: "name") group = jsonDictionary.json(atKeyPath: "group")