@@ -17,7 +17,7 @@ import func TSCBasic.topologicalSort
17
17
/// Represents a fully resolved target. All the dependencies for the target are resolved.
18
18
public final class ResolvedTarget {
19
19
/// Represents dependency of a resolved target.
20
- public enum Dependency : Hashable {
20
+ public enum Dependency {
21
21
/// Direct dependency of the target. This target is in the same package and should be statically linked.
22
22
case target( _ target: ResolvedTarget , conditions: [ PackageCondition ] )
23
23
@@ -171,6 +171,30 @@ extension ResolvedTarget: CustomStringConvertible {
171
171
}
172
172
}
173
173
174
+ extension ResolvedTarget . Dependency : Equatable {
175
+ public static func == ( lhs: ResolvedTarget . Dependency , rhs: ResolvedTarget . Dependency ) -> Bool {
176
+ switch ( lhs, rhs) {
177
+ case ( . target( let lhsTarget, _) , . target( let rhsTarget, _) ) :
178
+ return lhsTarget == rhsTarget
179
+ case ( . product( let lhsProduct, _) , . product( let rhsProduct, _) ) :
180
+ return lhsProduct == rhsProduct
181
+ case ( . product, . target) , ( . target, . product) :
182
+ return false
183
+ }
184
+ }
185
+ }
186
+
187
+ extension ResolvedTarget . Dependency : Hashable {
188
+ public func hash( into hasher: inout Hasher ) {
189
+ switch self {
190
+ case . target( let target, _) :
191
+ hasher. combine ( target)
192
+ case . product( let product, _) :
193
+ hasher. combine ( product)
194
+ }
195
+ }
196
+ }
197
+
174
198
extension ResolvedTarget . Dependency : CustomStringConvertible {
175
199
public var description : String {
176
200
var str = " <ResolvedTarget.Dependency: "
0 commit comments