Skip to content

Commit

Permalink
support single string for include
Browse files Browse the repository at this point in the history
  • Loading branch information
yonaskolb committed Sep 24, 2017
1 parent a20885e commit 39c8af3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
11 changes: 10 additions & 1 deletion Sources/XcodeGenKit/SpecLoader.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,16 @@ public struct SpecLoader {
throw JSONUtilsError.fileNotAJSONDictionary
}

if let includes = json["include"] as? [String] {
var includes: [String]
if let includeString = json["include"] as? String {
includes = [includeString]
} else if let includeArray = json["include"] as? [String] {
includes = includeArray
} else {
includes = []
}

if !includes.isEmpty {
var includeDictionary: JSONDictionary = [:]
for include in includes {
let includePath = path.parent() + include
Expand Down
2 changes: 1 addition & 1 deletion docs/ProjectSpec.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ Required properties are marked 🔵 and optional properties with ⚪️.
## Project

- 🔵 **name**: `String` - Name of the generated project
- ⚪️ **include**: `[String]` - The paths to other specs. They will be merged in order and then the current spec will be merged on top. Target names can be changed by adding a `name` property
- ⚪️ **include**: `[String]` - The paths to other specs. They will be merged in order and then the current spec will be merged on top. Target names can be changed by adding a `name` property. This can also be set as a single path string
- ⚪️ **options**: [Options](#options) - Various options to override default behaviour
- ⚪️ **attributes**: `map` - The PBXProject attributes. This is for advanced use. Defaults to ``{"LastUpgradeCheck": "0900"}``
- ⚪️ **configs**: [Configs](#configs) - Project build configurations. Defaults to `Debug` and `Release` configs
Expand Down

0 comments on commit 39c8af3

Please sign in to comment.