mirror of
https://github.com/yonaskolb/XcodeGen.git
synced 2026-03-18 20:02:25 +00:00
Removed localPackages variable
This commit is contained in:
@@ -20,7 +20,6 @@ public struct Project: BuildSettingsContainer {
|
||||
}
|
||||
|
||||
public var packages: [String: SwiftPackage]
|
||||
public var localPackages: [String: LocalSwiftPackage]
|
||||
|
||||
public var settings: Settings
|
||||
public var settingGroups: [String: Settings]
|
||||
@@ -51,7 +50,6 @@ public struct Project: BuildSettingsContainer {
|
||||
settingGroups: [String: Settings] = [:],
|
||||
schemes: [Scheme] = [],
|
||||
packages: [String: SwiftPackage] = [:],
|
||||
localPackages: [String: LocalSwiftPackage] = [:],
|
||||
options: SpecOptions = SpecOptions(),
|
||||
fileGroups: [String] = [],
|
||||
configFiles: [String: String] = [:],
|
||||
@@ -69,7 +67,6 @@ public struct Project: BuildSettingsContainer {
|
||||
self.settingGroups = settingGroups
|
||||
self.schemes = schemes
|
||||
self.packages = packages
|
||||
self.localPackages = localPackages
|
||||
self.options = options
|
||||
self.fileGroups = fileGroups
|
||||
self.configFiles = configFiles
|
||||
@@ -147,7 +144,6 @@ extension Project: Equatable {
|
||||
lhs.configFiles == rhs.configFiles &&
|
||||
lhs.options == rhs.options &&
|
||||
lhs.packages == rhs.packages &&
|
||||
lhs.localPackages == rhs.localPackages &&
|
||||
NSDictionary(dictionary: lhs.attributes).isEqual(to: rhs.attributes)
|
||||
}
|
||||
}
|
||||
@@ -188,12 +184,10 @@ extension Project {
|
||||
} else {
|
||||
packages = [:]
|
||||
}
|
||||
if let localPackages: [String: LocalSwiftPackage] = jsonDictionary.json(atKeyPath: "localPackages") {
|
||||
self.localPackages = localPackages
|
||||
if let localPackages: [String: SwiftPackage] = jsonDictionary.json(atKeyPath: "localPackages") {
|
||||
packages.merge(localPackages)
|
||||
} else if let localPackages: [String] = jsonDictionary.json(atKeyPath: "localPackages") {
|
||||
self.localPackages = localPackages.reduce(into: [String: LocalSwiftPackage](), { $0[$1] = LocalSwiftPackage(path: $1) })
|
||||
} else {
|
||||
self.localPackages = [:]
|
||||
packages.merge(localPackages.reduce(into: [String: SwiftPackage](), { $0[$1] = SwiftPackage(kind: .local(path: $1)) }))
|
||||
}
|
||||
if jsonDictionary["options"] != nil {
|
||||
options = try jsonDictionary.json(atKeyPath: "options")
|
||||
@@ -224,7 +218,6 @@ extension Project: PathContainer {
|
||||
static var pathProperties: [PathProperty] {
|
||||
[
|
||||
.string("configFiles"),
|
||||
.string("localPackages"),
|
||||
.object("options", SpecOptions.pathProperties),
|
||||
.object("targets", Target.pathProperties),
|
||||
.object("targetTemplates", Target.pathProperties),
|
||||
@@ -291,7 +284,6 @@ extension Project: JSONEncodable {
|
||||
dictionary["include"] = include
|
||||
dictionary["attributes"] = attributes
|
||||
dictionary["packages"] = packages.mapValues { $0.toJSONValue() }
|
||||
dictionary["localPackages"] = localPackages.mapValues { $0.toJSONValue() }
|
||||
dictionary["targets"] = Dictionary(uniqueKeysWithValues: targetPairs)
|
||||
dictionary["configs"] = Dictionary(uniqueKeysWithValues: configsPairs)
|
||||
dictionary["aggregateTargets"] = Dictionary(uniqueKeysWithValues: aggregateTargetsPairs)
|
||||
|
||||
@@ -52,12 +52,6 @@ extension Project {
|
||||
errors.append(.invalidFileGroup(fileGroup))
|
||||
}
|
||||
}
|
||||
|
||||
for (name, package) in localPackages {
|
||||
if !(basePath + Path(package.path).normalize()).exists {
|
||||
errors.append(.invalidLocalPackage(name))
|
||||
}
|
||||
}
|
||||
|
||||
for (name, package) in packages {
|
||||
if case let .local(path) = package.kind, !(basePath + Path(path).normalize()).exists {
|
||||
@@ -179,7 +173,7 @@ extension Project {
|
||||
}
|
||||
}
|
||||
case .package:
|
||||
if packages[dependency.reference] == nil, localPackages[dependency.reference] == nil {
|
||||
if packages[dependency.reference] == nil {
|
||||
errors.append(.invalidSwiftPackage(name: dependency.reference, target: target.name))
|
||||
}
|
||||
default: break
|
||||
|
||||
Reference in New Issue
Block a user