File tree Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Expand file tree Collapse file tree 3 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -332,6 +332,10 @@ public struct SwiftToolOptions: ParsableArguments {
332332 /// - important: Respects `--netrcOptional` option.
333333 @Option ( name: . customLong( " netrc-file " ) , completion: . file( ) )
334334 var netrcFilePath : AbsolutePath ?
335+
336+ @Flag ( name: . customLong( " enable-package-registry " ) ,
337+ help: " Enable dependency resolution using package registries when available " )
338+ var enablePackageRegistry : Bool = false
335339
336340 public init ( ) { }
337341}
Original file line number Diff line number Diff line change @@ -565,7 +565,8 @@ public class SwiftTool {
565565 isResolverPrefetchingEnabled: options. shouldEnableResolverPrefetching,
566566 skipUpdate: options. skipDependencyUpdate,
567567 enableResolverTrace: options. enableResolverTrace,
568- cachePath: cachePath
568+ cachePath: cachePath,
569+ enablePackageRegistry: options. enablePackageRegistry
569570 )
570571 _workspace = workspace
571572 _workspaceDelegate = delegate
Original file line number Diff line number Diff line change @@ -230,6 +230,8 @@ public class Workspace {
230230
231231 fileprivate let additionalFileRules : [ FileRuleDescription ]
232232
233+ fileprivate let enablePackageRegistry : Bool
234+
233235 /// Create a new package workspace.
234236 ///
235237 /// This will automatically load the persisted state for the package, if
@@ -266,7 +268,8 @@ public class Workspace {
266268 enablePubgrubResolver: Bool = false ,
267269 skipUpdate: Bool = false ,
268270 enableResolverTrace: Bool = false ,
269- cachePath: AbsolutePath ? = nil
271+ cachePath: AbsolutePath ? = nil ,
272+ enablePackageRegistry: Bool = false
270273 ) {
271274 self . delegate = delegate
272275 self . dataPath = dataPath
@@ -302,6 +305,8 @@ public class Workspace {
302305 cachePath: repositoriesCachePath)
303306 self . repositoryManager = repositoryManager
304307
308+ self . enablePackageRegistry = enablePackageRegistry
309+
305310 self . checkoutsPath = self . dataPath. appending ( component: " checkouts " )
306311 self . artifactsPath = self . dataPath. appending ( component: " artifacts " )
307312
You can’t perform that action at this time.
0 commit comments