mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Merge pull request #100 from yonaskolb/clear_project_settings
Don't apply base project settings if config doesn't have a type
This commit is contained in:
@@ -16,11 +16,10 @@ import JSONUtilities
|
||||
extension ProjectSpec {
|
||||
|
||||
public func getProjectBuildSettings(config: Config) -> BuildSettings {
|
||||
|
||||
var buildSettings: BuildSettings = [:]
|
||||
buildSettings += SettingsPresetFile.base.getBuildSettings()
|
||||
|
||||
if let type = config.type {
|
||||
buildSettings += SettingsPresetFile.base.getBuildSettings()
|
||||
buildSettings += SettingsPresetFile.config(type).getBuildSettings()
|
||||
}
|
||||
|
||||
|
||||
@@ -62,6 +62,15 @@ func projectGeneratorTests() {
|
||||
try expect(configs).contains(name: "config1")
|
||||
try expect(configs).contains(name: "config2")
|
||||
}
|
||||
|
||||
$0.it("clears config settings when missing type") {
|
||||
let spec = ProjectSpec(name: "test", configs: [Config(name: "config")])
|
||||
let project = try getProject(spec)
|
||||
guard let config = project.pbxproj.buildConfigurations.first else {
|
||||
throw failure("configuration not found")
|
||||
}
|
||||
try expect(config.buildSettings.isEmpty).to.beTrue()
|
||||
}
|
||||
|
||||
$0.it("merges settings") {
|
||||
let spec = try ProjectSpec(path: fixturePath + "settings_test.yml")
|
||||
|
||||
Reference in New Issue
Block a user