Make hash a String

This commit is contained in:
Andrea Cipriani 2019-12-07 16:02:46 +01:00
parent 2b298bf00d
commit c2325741a0
1 changed files with 4 additions and 4 deletions

View File

@ -2,19 +2,19 @@ import Foundation
import TuistCore
public protocol GraphContentHashing {
func contentHashes(for graph: Graphing) -> Dictionary<TargetNode, Int>
func contentHashes(for graph: Graphing) -> Dictionary<TargetNode, String>
}
public final class GraphContentHasher: GraphContentHashing {
public init() {}
public func contentHashes(for graph: Graphing) -> Dictionary<TargetNode, Int> {
public func contentHashes(for graph: Graphing) -> Dictionary<TargetNode, String> {
let hashableTargets = graph.targets.filter { $0.target.product == .framework }
let hashes = hashableTargets.map { makeContentHash(of: $0) }
return Dictionary(uniqueKeysWithValues: zip(hashableTargets, hashes))
}
private func makeContentHash(of targetNode: TargetNode) -> Int {
return -1 //TODO: will be implemented in subsequent PR
private func makeContentHash(of targetNode: TargetNode) -> String {
return "" //TODO: will be implemented in subsequent PR
}
}