mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
added () to config variant trimming character set (#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 <yonaskolb@users.noreply.github.com> * fixed incorrect test case Co-authored-by: Yonas Kolb <yonaskolb@users.noreply.github.com>
This commit is contained in:
@@ -2,6 +2,9 @@
|
||||
|
||||
## Next Version
|
||||
|
||||
#### Fixed
|
||||
- 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
|
||||
|
||||
## 2.22.0
|
||||
|
||||
#### Added
|
||||
|
||||
@@ -28,7 +28,7 @@ extension Config {
|
||||
guard self.type == type else { return false }
|
||||
let nameWithoutType = self.name.lowercased()
|
||||
.replacingOccurrences(of: type.name.lowercased(), with: "")
|
||||
.trimmingCharacters(in: CharacterSet(charactersIn: " -_"))
|
||||
.trimmingCharacters(in: CharacterSet(charactersIn: " -_()"))
|
||||
return nameWithoutType == variant.lowercased()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -359,6 +359,9 @@ class ProjectSpecTests: XCTestCase {
|
||||
try expectVariant("Dev", for: Config(name: "Dev_debug", type: .debug), matches: true)
|
||||
try expectVariant("Prod", for: Config(name: "PreProd debug", type: .debug), matches: false)
|
||||
try expectVariant("Develop", for: Config(name: "Dev debug", type: .debug), matches: false)
|
||||
try expectVariant("Development", for: Config(name: "Debug (Development)", type: .debug), matches: true)
|
||||
try expectVariant("Staging", for: Config(name: "Debug (Staging)", type: .debug), matches: true)
|
||||
try expectVariant("Production", for: Config(name: "Debug (Production)", type: .debug), matches: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user