Run SwiftFormat.

This commit is contained in:
Doug
2026-05-27 14:38:50 +01:00
committed by Doug
parent 5138e05e47
commit fa67713726
573 changed files with 2426 additions and 2426 deletions
@@ -6,14 +6,14 @@ struct GenerateSDKMocks: AsyncParsableCommand {
enum GenerateSDKMocksError: Error {
case invalidFileUrl
}
static let configuration = CommandConfiguration(abstract: "A tool to setup the mocks for the Matrix Rust SDK")
@Argument(help: "The argument to specify a branch of the SDK. Use `local` to use your local version")
var version: String
private var fileURLFormat = "https://raw.githubusercontent.com/element-hq/matrix-rust-components-swift/%@/Sources/MatrixRustSDK/matrix_sdk_ffi.swift"
func run() async throws {
if version == "local" {
try generateSDKMocks(ffiPath: "\(URL.sdkDirectory.path)/bindings/apple/generated/swift")
@@ -23,12 +23,12 @@ struct GenerateSDKMocks: AsyncParsableCommand {
try FileManager.default.removeItem(atPath: path)
}
}
/// Generates the SDK mocks using Sourcery.
func generateSDKMocks(ffiPath: String) throws {
try Zsh.run(command: "sourcery --sources \(ffiPath) --templates Tools/Sourcery/SDKAutoMockable.stencil --output SDKMocks/Sources/Generated/SDKGeneratedMocks.swift")
}
/// Downloads the specified version of the `matrix_sdk_ffi.swift` file and returns the path to the downloaded file.
func downloadSDK(version: String) async throws -> String {
let fileURLString = String(format: fileURLFormat, version)