Bump the RustSDK to v25.01.15 and fix (most) concurrency sendability warnings in the generated mocks.

This commit is contained in:
Stefan Ceriu
2025-01-15 12:29:17 +02:00
committed by Stefan Ceriu
parent e3ad925285
commit 0bcc59ae0a
20 changed files with 209 additions and 116 deletions
+12 -1
View File
@@ -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 %}
-3
View File
@@ -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]
+5 -1
View File
@@ -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())