Optionally make intermediate filler groups

This commit adds a new option `createIntermediateGroups` that defaults
to false. When it is false, the behavior of XcodeGen is the same as
before. When it is true, we make intermediate groups recursively until
we reach the basePath. In practice that means if you've chosen
`Platform/PINFoundation/Sources` as one of your sourcePaths, you get a
top-level group of `Platform` and under that `PINFoundation` and under
that `Sources`. This is instead of the default behavior of just making
`Sources` a top-level group (which is confusing when your directory is
called `Sources` for example).
This commit is contained in:
Brandon Kase
2017-11-01 18:02:31 -07:00
parent b274ae6f63
commit e48045da9e
5 changed files with 70 additions and 9 deletions
+3
View File
@@ -29,6 +29,7 @@ public struct ProjectSpec {
public struct Options {
public var carthageBuildPath: String?
public var createIntermediateGroups: Bool
public var bundleIdPrefix: String?
public var settingPresets: SettingPresets = .all
@@ -54,6 +55,7 @@ public struct ProjectSpec {
}
public init() {
createIntermediateGroups = false
}
}
@@ -160,5 +162,6 @@ extension ProjectSpec.Options: JSONObjectConvertible {
carthageBuildPath = jsonDictionary.json(atKeyPath: "carthageBuildPath")
bundleIdPrefix = jsonDictionary.json(atKeyPath: "bundleIdPrefix")
settingPresets = jsonDictionary.json(atKeyPath: "settingPresets") ?? .all
createIntermediateGroups = jsonDictionary.json(atKeyPath: "createIntermediateGroups") ?? false
}
}