mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 06:55:59 +00:00
Bump the RustSDK to v25.01.15 and fix (most) concurrency sendability warnings in the generated mocks.
This commit is contained in:
committed by
Stefan Ceriu
parent
e3ad925285
commit
0bcc59ae0a
@@ -1,4 +1,15 @@
|
||||
// swiftlint:disable all
|
||||
@preconcurrency import Combine
|
||||
@preconcurrency import SwiftUI
|
||||
|
||||
@preconcurrency import MatrixRustSDK
|
||||
|
||||
import AnalyticsEvents
|
||||
import AVFoundation
|
||||
import Foundation
|
||||
import LocalAuthentication
|
||||
import Photos
|
||||
|
||||
{% for import in argument.autoMockableImports %}
|
||||
import {{ import }}
|
||||
{% endfor %}
|
||||
@@ -221,7 +232,7 @@ import {{ import }}
|
||||
{% macro underlyingMockedVariableName variable %}underlying{{ variable.name|upperFirstLetter }}{% endmacro %}
|
||||
{% macro mockedVariableName variable %}{{ variable.name }}{% endmacro %}
|
||||
{% for type in types.protocols where type.based.AutoMockable or type|annotated:"AutoMockable" %}{% if type.name != "AutoMockable" %}
|
||||
{% call accessLevel type.accessLevel %}class {{ type.name | replace:"Protocol","" }}Mock: {{ type.name }} {
|
||||
{% call accessLevel type.accessLevel %}class {{ type.name | replace:"Protocol","" }}Mock: {{ type.name }}, @unchecked Sendable {
|
||||
{% if type.accessLevel == "public" %}public init() {}{% endif %}
|
||||
{% for variable in type.allVariables|!definedInExtension %}
|
||||
{% if variable.isAsync or variable.throws %}{% call mockAsyncOrThrowingVariable variable %}{% elif variable.isOptional %}{% call mockOptionalVariable variable %}{% elif variable.isArray or variable.isDictionary %}{% call mockNonOptionalArrayOrDictionaryVariable variable %}{% else %}{% call mockNonOptionalVariable variable %}{% endif %}
|
||||
|
||||
@@ -7,6 +7,3 @@ templates:
|
||||
- AutoMockable.stencil
|
||||
output:
|
||||
../../ElementX/Sources/Mocks/Generated/GeneratedMocks.swift
|
||||
args:
|
||||
automMockableTestableImports: []
|
||||
autoMockableImports: [AnalyticsEvents, AVFoundation, Combine, Foundation, LocalAuthentication, MatrixRustSDK, Photos, SwiftUI]
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
// swiftlint:disable all
|
||||
@preconcurrency import MatrixRustSDK
|
||||
|
||||
import Foundation
|
||||
|
||||
{% for import in argument.autoMockableImports %}
|
||||
import {{ import }}
|
||||
{% endfor %}
|
||||
@@ -218,7 +222,7 @@ import {{ import }}
|
||||
{% macro underlyingMockedVariableName variable %}underlying{{ variable.name|upperFirstLetter }}{% endmacro %}
|
||||
{% macro mockedVariableName variable %}{{ variable.name }}{% endmacro %}
|
||||
{% for type in types.classes %}{% if type.name != "AutoMockable" %}{% if type.accessLevel == "open" %}
|
||||
{% call accessLevel type.accessLevel %}class {{ type.name | replace:"Protocol","" }}SDKMock: MatrixRustSDK.{{ type.name }} {
|
||||
{% call accessLevel type.accessLevel %}class {{ type.name | replace:"Protocol","" }}SDKMock: MatrixRustSDK.{{ type.name }}, @unchecked Sendable {
|
||||
{% if type.accessLevel == "open" %}
|
||||
init() {
|
||||
super.init(noPointer: .init())
|
||||
|
||||
@@ -27,7 +27,7 @@ struct GenerateSDKMocks: ParsableCommand {
|
||||
|
||||
/// Generates the SDK mocks using Sourcery.
|
||||
func generateSDKMocks(ffiPath: String) throws {
|
||||
try Zsh.run(command: "sourcery --sources \(ffiPath) --templates Tools/Sourcery/SDKAutoMockable.stencil --output ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift --args autoMockableImports=\"Foundation\",autoMockableImports=\"MatrixRustSDK\"")
|
||||
try Zsh.run(command: "sourcery --sources \(ffiPath) --templates Tools/Sourcery/SDKAutoMockable.stencil --output ElementX/Sources/Mocks/Generated/SDKGeneratedMocks.swift")
|
||||
}
|
||||
|
||||
/// Downloads the specified version of the `matrix_sdk_ffi.swift` file and returns the path to the downloaded file.
|
||||
|
||||
Reference in New Issue
Block a user