mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Optimize simplifying paths for faster project generation (#857)
This commit is contained in:
@@ -26,6 +26,7 @@
|
||||
- Fix linking of multiple products from the same Swift Package [#830](https://github.com/yonaskolb/XcodeGen/pull/830) @toshi0383
|
||||
- Don't deduplicate files in `include` with different path but same name. [#849](https://github.com/yonaskolb/XcodeGen/pull/849) @akkyie
|
||||
- Don't link transitive static carthage libraries. [#853](https://github.com/yonaskolb/XcodeGen/pull/853) @akkyie
|
||||
- Optimize simplifying paths for faster project generation. [#857](https://github.com/yonaskolb/XcodeGen/pull/857) @akkyie
|
||||
|
||||
## 2.15.1
|
||||
|
||||
|
||||
@@ -11,7 +11,14 @@ extension Path {
|
||||
/// - `../a/b` simplifies to `../a/b`
|
||||
/// - `a/../../c` simplifies to `../c`
|
||||
public func simplifyingParentDirectoryReferences() -> Path {
|
||||
normalize().components.reduce(Path(), +)
|
||||
if !string.contains("..") { // Skip simplifying if its already simple
|
||||
var string = self.string
|
||||
while string.hasSuffix(Path.separator) { // Remove all trailing path separators
|
||||
string.removeLast()
|
||||
}
|
||||
return Path(String(string))
|
||||
}
|
||||
return normalize().components.reduce(Path(), +)
|
||||
}
|
||||
|
||||
/// Returns the relative path necessary to go from `base` to `self`.
|
||||
|
||||
Reference in New Issue
Block a user