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
+5 -1
View File
@@ -32,6 +32,7 @@ public struct ProjectSpec {
public var indentWidth: UInt?
public var xcodeVersion: String?
public var deploymentTarget: DeploymentTarget
public var defaultConfigurationName: String?
public enum SettingPresets: String {
case all
@@ -66,7 +67,8 @@ public struct ProjectSpec {
usesTabs: Bool? = nil,
xcodeVersion: String? = nil,
deploymentTarget: DeploymentTarget = .init(),
disabledValidations: [ValidationType] = []
disabledValidations: [ValidationType] = [],
defaultConfigurationName: String? = nil
) {
self.carthageBuildPath = carthageBuildPath
self.carthageExecutablePath = carthageExecutablePath
@@ -80,6 +82,7 @@ public struct ProjectSpec {
self.xcodeVersion = xcodeVersion
self.deploymentTarget = deploymentTarget
self.disabledValidations = disabledValidations
self.defaultConfigurationName = defaultConfigurationName
}
public static func == (lhs: ProjectSpec.Options, rhs: ProjectSpec.Options) -> Bool {
@@ -217,5 +220,6 @@ extension ProjectSpec.Options: JSONObjectConvertible {
tabWidth = (jsonDictionary.json(atKeyPath: "tabWidth") as Int?).flatMap(UInt.init)
deploymentTarget = jsonDictionary.json(atKeyPath: "deploymentTarget") ?? DeploymentTarget()
disabledValidations = jsonDictionary.json(atKeyPath: "disabledValidations") ?? []
defaultConfigurationName = jsonDictionary.json(atKeyPath: "defaultConfigurationName")
}
}