mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
better build phases
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
|
||||
import Foundation
|
||||
import JSONUtilities
|
||||
import PathKit
|
||||
import Yams
|
||||
|
||||
extension Dictionary where Key: JSONKey {
|
||||
|
||||
@@ -46,3 +48,15 @@ public protocol NamedJSONConvertible {
|
||||
|
||||
init(name: String, json: Any) throws
|
||||
}
|
||||
|
||||
extension JSONObjectConvertible {
|
||||
|
||||
public init(path: Path) throws {
|
||||
let content: String = try path.read()
|
||||
let yaml = try Yams.load(yaml: content)
|
||||
guard let jsonDictionary = yaml as? JSONDictionary else {
|
||||
throw JSONUtilsError.fileNotAJSONDictionary
|
||||
}
|
||||
try self.init(jsonDictionary: jsonDictionary)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user