@@ -29,7 +29,7 @@ extension SwiftPackageCommand {
29
29
var packageName : String ?
30
30
}
31
31
32
- struct Resolve : SwiftCommand {
32
+ struct Resolve : AsyncSwiftCommand {
33
33
static let configuration = CommandConfiguration (
34
34
abstract: " Resolve package dependencies " )
35
35
@@ -39,11 +39,11 @@ extension SwiftPackageCommand {
39
39
@OptionGroup ( )
40
40
var resolveOptions : ResolveOptions
41
41
42
- func run( _ swiftCommandState: SwiftCommandState ) throws {
42
+ func run( _ swiftCommandState: SwiftCommandState ) async throws {
43
43
// If a package is provided, use that to resolve the dependencies.
44
44
if let packageName = resolveOptions. packageName {
45
45
let workspace = try swiftCommandState. getActiveWorkspace ( )
46
- try workspace. resolve (
46
+ try await workspace. resolve (
47
47
packageName: packageName,
48
48
root: swiftCommandState. getWorkspaceRoot ( ) ,
49
49
version: resolveOptions. version,
@@ -56,12 +56,12 @@ extension SwiftPackageCommand {
56
56
}
57
57
} else {
58
58
// Otherwise, run a normal resolve.
59
- try swiftCommandState. resolve ( )
59
+ try await swiftCommandState. resolve ( )
60
60
}
61
61
}
62
62
}
63
63
64
- struct Fetch : SwiftCommand {
64
+ struct Fetch : AsyncSwiftCommand {
65
65
static let configuration = CommandConfiguration ( shouldDisplay: false )
66
66
67
67
@OptionGroup ( visibility: . hidden)
@@ -70,11 +70,11 @@ extension SwiftPackageCommand {
70
70
@OptionGroup ( )
71
71
var resolveOptions : ResolveOptions
72
72
73
- func run( _ swiftCommandState: SwiftCommandState ) throws {
73
+ func run( _ swiftCommandState: SwiftCommandState ) async throws {
74
74
swiftCommandState. observabilityScope. emit ( warning: " 'fetch' command is deprecated; use 'resolve' instead " )
75
75
76
76
let resolveCommand = Resolve ( globalOptions: _globalOptions, resolveOptions: _resolveOptions)
77
- try resolveCommand. run ( swiftCommandState)
77
+ try await resolveCommand. run ( swiftCommandState)
78
78
}
79
79
}
80
80
}
0 commit comments