mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Add defaultConfigurationName to options
This allows users to set the defaultConfigurationName project wide. This setting corresponds to the drop down in the project settings that says "Use CONFIG for command line builds". This affects which configuration Xcode looks in for some settings, even if you pass `-configuration FOO`.
This commit is contained in:
@@ -96,6 +96,20 @@ func projectGeneratorTests() {
|
||||
try expect(XCodeVersion.parse(version)) == expected
|
||||
}
|
||||
}
|
||||
|
||||
$0.it("uses the default configuration name") {
|
||||
let options = ProjectSpec.Options(defaultConfigurationName: "Bconfig")
|
||||
let spec = ProjectSpec(basePath: "", name: "test", configs: [Config(name: "Aconfig"), Config(name: "Bconfig")], targets: [framework], options: options)
|
||||
let pbxProject = try getPbxProj(spec)
|
||||
|
||||
guard let projectConfigListReference = pbxProject.objects.projects.values.first?.buildConfigurationList,
|
||||
let defaultConfigurationName = pbxProject.objects.configurationLists[projectConfigListReference]?.defaultConfigurationName
|
||||
else {
|
||||
throw failure("Default configuration name not found")
|
||||
}
|
||||
|
||||
try expect(defaultConfigurationName) == "Bconfig"
|
||||
}
|
||||
}
|
||||
|
||||
$0.describe("Config") {
|
||||
|
||||
Reference in New Issue
Block a user