Skip to content

Commit 26a0942

Browse files
committed
TEMP: placeholder mapping from registry identity to location
FIXME: temporary change to get registry resolution working
1 parent 1cddf94 commit 26a0942

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

Sources/PackageLoading/IdentityResolver.swift

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,16 @@ public struct DefaultIdentityResolver: IdentityResolver {
2727

2828
public func resolveIdentity(for location: String) -> PackageIdentity {
2929
let location = self.resolveLocation(from: location)
30-
return PackageIdentity(url: location)
30+
31+
let components = location.split(separator: "/")
32+
guard components.count == 2,
33+
let scope = components.first,
34+
let name = components.last
35+
else {
36+
return PackageIdentity(url: location)
37+
}
38+
39+
return PackageIdentity.plain("\(scope).\(name)")
3140
}
3241

3342
public func resolveIdentity(for path: AbsolutePath) -> PackageIdentity {

Sources/PackageModel/Manifest/PackageDependencyDescription.swift

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,8 @@ public enum PackageDependency: Equatable {
120120
return data.path.pathString
121121
case .sourceControl(let data):
122122
return data.location
123-
case .registry:
124-
// FIXME
125-
fatalError("registry based dependencies not implemented yet")
123+
case .registry(let data):
124+
return data.identity.description.replacingOccurrences(of: ".", with: "/") // FIXME: formalize mapping from identity to location
126125
}
127126
}
128127

0 commit comments

Comments
 (0)