Add back deleted public functions and deprecate (prevent breaking public API)

This commit is contained in:
Ell Neal 2019-01-15 12:23:52 +00:00
parent b144db3d70
commit 8f4c0953b3
No known key found for this signature in database
GPG Key ID: 0AAD6C98BA484C61
2 changed files with 11 additions and 0 deletions

View File

@ -132,6 +132,12 @@ extension Project: Equatable {
extension Project {
@available(*, deprecated, message: "Use `Project.Spec` and `init(spec:basePath:)`.")
public init(basePath: Path, jsonDictionary: JSONDictionary) throws {
let spec = Project.Spec(relativePath: Path(), jsonDictionary: jsonDictionary)
try self.init(spec: spec, basePath: basePath)
}
public init(spec: Spec, basePath: Path) throws {
self.basePath = basePath

View File

@ -10,6 +10,11 @@ extension Project {
let template = try Spec(filename: path.lastComponent, basePath: basePath)
try self.init(spec: template, basePath: basePath)
}
@available(*, deprecated, message: "Use `Project.Spec` for loading files from disk.")
public static func loadDictionary(path: Path) throws -> JSONDictionary {
return try Project.Spec(filename: path.lastComponent, basePath: path.parent()).jsonDictionary
}
}
protocol PathContaining {