mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Sanitize the ends of folder source paths (#1341)
* Sanitize the ends of folder source paths Setting the source: `/foo/bar` is _sometimes_ different from `/foo/bar/` even if `bar` is a folder in both cases. The result of this is that we often run into a race condition where we have two objects with the same hash but different properties. This fixes #1339 and #1131. * Update CHANGELOG.md * Update TargetSource.swift * Update TargetSource.swift * Update TargetSource.swift
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user