Created
December 25, 2015 04:17
-
-
Save ikesyo/c3574c268c650cb1d27a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/Source/CarthageKit/Cartfile.swift b/Source/CarthageKit/Cartfile.swift | |
index b1b1b46..172b3c2 100644 | |
--- a/Source/CarthageKit/Cartfile.swift | |
+++ b/Source/CarthageKit/Cartfile.swift | |
@@ -274,11 +274,14 @@ public struct Dependency<V: VersionType>: Equatable { | |
/// The project corresponding to this dependency. | |
public let project: ProjectIdentifier | |
+ public let dependencyOf: ProjectIdentifier? | |
+ | |
/// The version(s) that are required to satisfy this dependency. | |
public var version: V | |
- public init(project: ProjectIdentifier, version: V) { | |
+ public init(project: ProjectIdentifier, dependencyOf: ProjectIdentifier?, version: V) { | |
self.project = project | |
+ self.dependencyOf = dependencyOf | |
self.version = version | |
} | |
} | |
@@ -291,7 +294,7 @@ extension Dependency where V: Scannable { | |
/// Attempts to parse a Dependency specification. | |
public static func fromScanner(scanner: NSScanner) -> Result<Dependency, CarthageError> { | |
return ProjectIdentifier.fromScanner(scanner).flatMap { identifier in | |
- return V.fromScanner(scanner).map { specifier in self.init(project: identifier, version: specifier) } | |
+ return V.fromScanner(scanner).map { specifier in self.init(project: identifier, dependencyOf: nil, version: specifier) } | |
} | |
} | |
} | |
diff --git a/Source/CarthageKit/Resolver.swift b/Source/CarthageKit/Resolver.swift | |
index 884880b..fa0cae0 100644 | |
--- a/Source/CarthageKit/Resolver.swift | |
+++ b/Source/CarthageKit/Resolver.swift | |
@@ -490,9 +490,11 @@ private class DependencyNode: Comparable { | |
/// The dependencies of this node. | |
var dependencies: Set<DependencyNode> = [] | |
+ var dependencyOf: DependencyNode? | |
+ | |
/// A Dependency equivalent to this node. | |
var dependencyVersion: Dependency<PinnedVersion> { | |
- return Dependency(project: project, version: proposedVersion) | |
+ return Dependency(project: project, dependencyOf: dependencyOf?.project, version: proposedVersion) | |
} | |
init(project: ProjectIdentifier, proposedVersion: PinnedVersion, versionSpecifier: VersionSpecifier) { |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment