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:
Keith Smiley
2018-03-19 13:47:02 -07:00
parent ad3aaaa259
commit e636664aaa
6 changed files with 36 additions and 2 deletions
@@ -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") {