@@ -58,10 +58,10 @@ public final class RegistryManager {
58
58
}
59
59
60
60
public func fetchVersions(
61
- of package : PackageIdentity ,
62
- timeout: DispatchTimeInterval ? = nil ,
63
- callbackQueue: DispatchQueue = . sharedConcurrent,
61
+ package : PackageIdentity ,
62
+ timeout: DispatchTimeInterval ? = . none,
64
63
observabilityScope: ObservabilityScope ,
64
+ callbackQueue: DispatchQueue ,
65
65
completion: @escaping ( Result < [ Version ] , Error > ) -> Void
66
66
) {
67
67
let completion = self . makeAsync ( completion, on: callbackQueue)
@@ -112,14 +112,13 @@ public final class RegistryManager {
112
112
}
113
113
114
114
public func fetchManifest(
115
- for version: Version ,
116
- of package : PackageIdentity ,
117
- using manifestLoader: ManifestLoaderProtocol ,
118
- toolsVersion: ToolsVersion = . currentToolsVersion,
119
- swiftLanguageVersion: SwiftLanguageVersion ? = nil ,
120
- timeout: DispatchTimeInterval ? = nil ,
121
- callbackQueue: DispatchQueue = . sharedConcurrent,
115
+ package : PackageIdentity ,
116
+ version: Version ,
117
+ manifestLoader: ManifestLoaderProtocol ,
118
+ toolsVersion: ToolsVersion ? ,
119
+ timeout: DispatchTimeInterval ? = . none,
122
120
observabilityScope: ObservabilityScope ,
121
+ callbackQueue: DispatchQueue ,
123
122
completion: @escaping ( Result < Manifest , Error > ) -> Void
124
123
) {
125
124
let completion = self . makeAsync ( completion, on: callbackQueue)
@@ -135,9 +134,9 @@ public final class RegistryManager {
135
134
var components = URLComponents ( url: registry. url, resolvingAgainstBaseURL: true )
136
135
components? . appendPathComponents ( " \( scope) " , " \( name) " , " \( version) " , " Package.swift " )
137
136
138
- if let swiftLanguageVersion = swiftLanguageVersion {
137
+ if let toolsVersion = toolsVersion {
139
138
components? . queryItems = [
140
- URLQueryItem ( name: " swift-version " , value: swiftLanguageVersion . rawValue ) ,
139
+ URLQueryItem ( name: " swift-version " , value: toolsVersion . description ) ,
141
140
]
142
141
}
143
142
@@ -169,8 +168,8 @@ public final class RegistryManager {
169
168
let fileSystem = InMemoryFileSystem ( )
170
169
171
170
let filename : String
172
- if let swiftLanguageVersion = swiftLanguageVersion {
173
- filename = Manifest . basename + " @swift- \( swiftLanguageVersion ) .swift "
171
+ if let toolsVersion = toolsVersion {
172
+ filename = Manifest . basename + " @swift- \( toolsVersion ) .swift "
174
173
} else {
175
174
filename = Manifest . basename + " .swift "
176
175
}
@@ -185,7 +184,7 @@ public final class RegistryManager {
185
184
packageLocation: package . description, // FIXME: was originally PackageReference.locationString
186
185
version: version,
187
186
revision: nil ,
188
- toolsVersion: . currentToolsVersion,
187
+ toolsVersion: toolsVersion ?? . currentToolsVersion,
189
188
identityResolver: self . identityResolver,
190
189
fileSystem: fileSystem,
191
190
observabilityScope: observabilityScope,
@@ -202,11 +201,11 @@ public final class RegistryManager {
202
201
}
203
202
204
203
public func fetchSourceArchiveChecksum(
205
- for version: Version ,
206
- of package : PackageIdentity ,
207
- timeout: DispatchTimeInterval ? = nil ,
208
- callbackQueue: DispatchQueue = . sharedConcurrent,
204
+ package : PackageIdentity ,
205
+ version: Version ,
206
+ timeout: DispatchTimeInterval ? = . none,
209
207
observabilityScope: ObservabilityScope ,
208
+ callbackQueue: DispatchQueue ,
210
209
completion: @escaping ( Result < String , Error > ) -> Void
211
210
) {
212
211
let completion = self . makeAsync ( completion, on: callbackQueue)
@@ -262,15 +261,15 @@ public final class RegistryManager {
262
261
}
263
262
264
263
public func downloadSourceArchive(
265
- for version : Version ,
266
- of package : PackageIdentity ,
267
- into fileSystem: FileSystem ,
268
- at destinationPath: AbsolutePath ,
269
- expectedChecksum: String ? = nil , // previously recorded checksum, if any
264
+ package : PackageIdentity ,
265
+ version : Version ,
266
+ fileSystem: FileSystem ,
267
+ destinationPath: AbsolutePath ,
268
+ expectedChecksum: String ? , // previously recorded checksum, if any
270
269
checksumAlgorithm: HashAlgorithm , // the same algorithm used by `package compute-checksum` tool
271
- timeout: DispatchTimeInterval ? = nil ,
272
- callbackQueue: DispatchQueue = . sharedConcurrent,
270
+ timeout: DispatchTimeInterval ? = . none,
273
271
observabilityScope: ObservabilityScope ,
272
+ callbackQueue: DispatchQueue ,
274
273
completion: @escaping ( Result < Void , Error > ) -> Void
275
274
) {
276
275
let completion = self . makeAsync ( completion, on: callbackQueue)
@@ -288,7 +287,13 @@ public final class RegistryManager {
288
287
if let expectedChecksum = expectedChecksum {
289
288
return body ( . success( expectedChecksum) )
290
289
}
291
- self . fetchSourceArchiveChecksum ( for: version, of: package , callbackQueue: callbackQueue, observabilityScope: observabilityScope, completion: body)
290
+ self . fetchSourceArchiveChecksum (
291
+ package : package ,
292
+ version: version,
293
+ observabilityScope: observabilityScope,
294
+ callbackQueue: callbackQueue,
295
+ completion: body
296
+ )
292
297
}
293
298
294
299
var components = URLComponents ( url: registry. url, resolvingAgainstBaseURL: true )
@@ -358,10 +363,10 @@ public final class RegistryManager {
358
363
}
359
364
360
365
public func lookupIdentities(
361
- for url: Foundation . URL ,
362
- timeout: DispatchTimeInterval ? = nil ,
363
- callbackQueue: DispatchQueue = . sharedConcurrent,
366
+ url: Foundation . URL ,
367
+ timeout: DispatchTimeInterval ? = . none,
364
368
observabilityScope: ObservabilityScope ,
369
+ callbackQueue: DispatchQueue ,
365
370
completion: @escaping ( Result < Set < PackageIdentity > , Error > ) -> Void
366
371
) {
367
372
let completion = self . makeAsync ( completion, on: callbackQueue)
0 commit comments