Make the BuildSDK tool an AsyncParsableCommand and avoid help showing up after the command is run.

This commit is contained in:
Stefan Ceriu
2025-06-26 15:40:56 +03:00
committed by Stefan Ceriu
parent 12bd687494
commit 5aa41736d6

View File

@@ -16,7 +16,7 @@ enum Target: String, ExpressibleByArgument, CaseIterable {
case macIntel = "x86_64-apple-darwin" case macIntel = "x86_64-apple-darwin"
} }
struct BuildSDK: ParsableCommand { struct BuildSDK: AsyncParsableCommand {
static let configuration = CommandConfiguration(abstract: "A tool to checkout and build MatrixRustSDK locally for development.") static let configuration = CommandConfiguration(abstract: "A tool to checkout and build MatrixRustSDK locally for development.")
@Argument(help: "An optional argument to specify a branch of the SDK.") @Argument(help: "An optional argument to specify a branch of the SDK.")
@@ -55,13 +55,13 @@ struct BuildSDK: ParsableCommand {
} }
} }
func run() throws { func run() async throws {
try checkRustupTargets() try checkRustupTargets()
try cloneSDKIfNeeded() try cloneSDKIfNeeded()
try checkoutBranchIfSupplied() try checkoutBranchIfSupplied()
try buildFramework() try buildFramework()
try updateXcodeProject() try updateXcodeProject()
try generateSDKMocks() try await generateSDKMocks()
} }
/// Checks that all of the required targets have been added through rustup /// Checks that all of the required targets have been added through rustup
@@ -134,9 +134,9 @@ struct BuildSDK: ParsableCommand {
try updatedYAMLString.write(to: yamlURL, atomically: true, encoding: .utf8) try updatedYAMLString.write(to: yamlURL, atomically: true, encoding: .utf8)
} }
func generateSDKMocks() throws { func generateSDKMocks() async throws {
var command = GenerateSDKMocks() var command = GenerateSDKMocks()
command.version = "local" command.version = "local"
try command.run() try await command.run()
} }
} }