Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b6d87a1

Browse files
added () to config variant trimming character set (yonaskolb#1078)
* added () to config variant trimming character set * added test cases * added test cases and changelog entry * Update CHANGELOG.md removed Co-authored-by: Yonas Kolb <[email protected]> * fixed incorrect test case Co-authored-by: Yonas Kolb <[email protected]>
1 parent dc8544f commit b6d87a1

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## Next Version
44

5+
#### Fixed
6+
- Added `()` to config variant trimming charater set to fix scheme config variant lookups for some configs like `Debug (Development)` that broke in 2.22.0 [#1078](https://github.com/yonaskolb/XcodeGen/pull/1078) @DavidWoohyunLee
7+
58
## 2.22.0
69

710
#### Added

Sources/ProjectSpec/Config.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ extension Config {
2828
guard self.type == type else { return false }
2929
let nameWithoutType = self.name.lowercased()
3030
.replacingOccurrences(of: type.name.lowercased(), with: "")
31-
.trimmingCharacters(in: CharacterSet(charactersIn: " -_"))
31+
.trimmingCharacters(in: CharacterSet(charactersIn: " -_()"))
3232
return nameWithoutType == variant.lowercased()
3333
}
3434
}

Tests/ProjectSpecTests/ProjectSpecTests.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,9 @@ class ProjectSpecTests: XCTestCase {
359359
try expectVariant("Dev", for: Config(name: "Dev_debug", type: .debug), matches: true)
360360
try expectVariant("Prod", for: Config(name: "PreProd debug", type: .debug), matches: false)
361361
try expectVariant("Develop", for: Config(name: "Dev debug", type: .debug), matches: false)
362+
try expectVariant("Development", for: Config(name: "Debug (Development)", type: .debug), matches: true)
363+
try expectVariant("Staging", for: Config(name: "Debug (Staging)", type: .debug), matches: true)
364+
try expectVariant("Production", for: Config(name: "Debug (Production)", type: .debug), matches: true)
362365
}
363366
}
364367
}

0 commit comments

Comments
 (0)