From 04a55fa30d3f195b97bd906132501efa62347b12 Mon Sep 17 00:00:00 2001 From: Christopher Kobusch Date: Mon, 8 May 2023 00:00:50 +0200 Subject: [PATCH 1/4] Swift package compatibility --- MatrixSDK.xcodeproj/project.pbxproj | 2 +- .../Realm/MXBeaconInfoSummaryRealmStore.swift | 9 ++-- .../Store/Realm/MXRealmBeacon.swift | 2 +- .../Store/Realm/MXRealmBeaconInfo.swift | 2 +- .../Realm/MXRealmBeaconInfoSummary.swift | 2 +- .../Crypto/MXBackgroundCryptoV2.swift | 2 +- .../RoomEvent/MXRoomEventDecryption.swift | 2 +- .../RoomEvent/MXRoomEventEncryption.swift | 2 +- .../Data/MXCryptoUserIdentityWrapper.swift | 2 +- .../EventEncryptionAlgorithm+String.swift | 2 +- .../MXDeviceVerification+LocalTrust.swift | 2 +- ...EventDecryptionResult+DecryptedEvent.swift | 2 +- ...mHistoryVisibility+HistoryVisibility.swift | 2 +- .../CryptoMachine/MXCryptoMachine.swift | 2 +- .../CryptoMachine/MXCryptoProtocols.swift | 2 +- .../CryptoMachine/MXCryptoRequests.swift | 2 +- .../CryptoMachine/MXCryptoSDKLogger.swift | 2 +- .../Devices/Data/MXCryptoDeviceWrapper.swift | 2 +- .../Engine/MXCryptoKeyBackupEngine.swift | 2 +- MatrixSDK/Crypto/MXCryptoV2.swift | 2 +- .../Data/MXCryptoMigrationStore.swift | 4 +- .../Migration/MXCryptoMigrationV2.swift | 4 +- .../MXKeyVerificationManagerV2.swift | 2 +- .../Requests/MXKeyVerificationRequestV2.swift | 2 +- .../QRCode/MXQRCodeTransactionV2.swift | 2 +- .../Transactions/SAS/MXSASTransactionV2.swift | 2 +- .../Utils/Logs/MXAnalyticsDestination.swift | 4 ++ MatrixSDK/Utils/Logs/MXLog.swift | 4 ++ MatrixSDK/Utils/Realm/RLMSupport.swift | 43 ++++++++++--------- MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift | 2 +- .../Megolm/MXMegolmDecryptionUnitTests.swift | 2 +- .../MXRoomEventDecryptionUnitTests.swift | 2 +- .../MXRoomEventEncryptionUnitTests.swift | 2 +- .../Data/MXCrossSigningInfoUnitTests.swift | 2 +- .../MXCrossSigningInfoSourceUnitTests.swift | 2 +- .../MXCrossSigningV2UnitTests.swift | 2 +- .../CryptoMachine/DecryptedEvent+Stub.swift | 2 +- .../Crypto/CryptoMachine/Device+Stub.swift | 2 +- .../EventEncryptionAlgorithmUnitTests.swift | 2 +- .../MXCryptoMachineUnitTests.swift | 2 +- .../CryptoMachine/MXCryptoProtocolStubs.swift | 2 +- .../MXCryptoRequestsUnitTests.swift | 2 +- .../Data/Store/MXMemoryCryptoStore.swift | 2 +- .../Devices/Data/MXDeviceInfoUnitTests.swift | 2 +- .../Devices/MXDeviceInfoSourceUnitTests.swift | 2 +- .../MXCryptoKeyBackupEngineUnitTests.swift | 2 +- .../MXCryptoMigrationStoreUnitTests.swift | 2 +- .../Trust/MXTrustLevelSourceUnitTests.swift | 2 +- .../MXKeyVerificationRequestV2UnitTests.swift | 2 +- .../Requests/VerificationRequestStub.swift | 2 +- .../MXQRCodeTransactionV2UnitTests.swift | 2 +- .../Transactions/QRCode/QrCodeStub.swift | 2 +- .../SAS/MXSASTransactionV2UnitTests.swift | 2 +- .../Transactions/SAS/SasStub.swift | 2 +- changelog.d/sdk-1497.build | 1 + 55 files changed, 88 insertions(+), 77 deletions(-) create mode 100644 changelog.d/sdk-1497.build diff --git a/MatrixSDK.xcodeproj/project.pbxproj b/MatrixSDK.xcodeproj/project.pbxproj index 643661e11e..33185391d3 100644 --- a/MatrixSDK.xcodeproj/project.pbxproj +++ b/MatrixSDK.xcodeproj/project.pbxproj @@ -8346,7 +8346,7 @@ MACOSX_DEPLOYMENT_TARGET = 10.15; MTL_ENABLE_DEBUG_INFO = YES; ONLY_ACTIVE_ARCH = YES; - OTHER_SWIFT_FLAGS = "-D DEBUG"; + OTHER_SWIFT_FLAGS = "-D DEBUG -D IS_TEST_RUN"; SDKROOT = ""; SWIFT_SWIFT3_OBJC_INFERENCE = On; SWIFT_VERSION = 5.0; diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift index a67ca8d1d5..5545ad8478 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXBeaconInfoSummaryRealmStore.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm @objcMembers public class MXBeaconInfoSummaryRealmStore: NSObject { @@ -155,10 +155,11 @@ public class MXBeaconInfoSummaryRealmStore: NSObject { private func beaconInfoSummaries(from realmBeaconInfoSummaryResults: RLMResults) -> [MXBeaconInfoSummary] { var summaries: [MXBeaconInfoSummary] = [] - - for realmSummary in realmBeaconInfoSummaryResults { + + var iterator = NSFastEnumerationIterator(realmBeaconInfoSummaryResults) + while let realmSummary = iterator.next() as? MXRealmBeaconInfoSummary { - if let realmBeaconInfoSummary = realmSummary as? MXRealmBeaconInfoSummary, let summary = self.mapper.beaconInfoSummary(from: realmBeaconInfoSummary) { + if let summary = self.mapper.beaconInfoSummary(from: realmSummary) { summaries.append(summary) } } diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift index df77263b9b..e31e3efd66 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeacon.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm class MXRealmBeacon: RLMObject { diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift index 5774fa584b..0ffc19fcb8 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfo.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm class MXRealmBeaconInfo: RLMObject { diff --git a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift index 74a23a7974..f57a9ede9e 100644 --- a/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift +++ b/MatrixSDK/Aggregations/LocationSharing/Store/Realm/MXRealmBeaconInfoSummary.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm class MXRealmBeaconInfoSummary: RLMObject { diff --git a/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift b/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift index d2db3ede3f..b340bad3f5 100644 --- a/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift +++ b/MatrixSDK/Background/Crypto/MXBackgroundCryptoV2.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// An implementation of `MXBackgroundCrypto` which uses [matrix-rust-sdk](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto) /// under the hood. diff --git a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift index 39545956db..7ba577845b 100644 --- a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift +++ b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventDecryption.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Object responsible for decrypting room events and dealing with undecryptable events protocol MXRoomEventDecrypting: Actor { diff --git a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift index fe9fa93268..cd6f91d9e5 100644 --- a/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift +++ b/MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Object responsible for encrypting room events and ensuring that room keys are distributed to room members protocol MXRoomEventEncrypting { diff --git a/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift b/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift index f444ca2eb2..b325a4ca45 100644 --- a/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift +++ b/MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Convenience wrapper around `MatrixSDKCrypto`'s `UserIdentity` /// which can be used to create `MatrixSDK`s `MXCrossSigningInfo` diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift index 21f5919733..f022605b4c 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithm+String.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension EventEncryptionAlgorithm { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift index e5287ce91d..ffae8e5323 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXDeviceVerification+LocalTrust.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension MXDeviceVerification { var localTrust: LocalTrust { diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift index b7d0249262..8f715e6bb6 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXEventDecryptionResult+DecryptedEvent.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension MXEventDecryptionResult { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift index a073deddb6..4a92183a32 100644 --- a/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift +++ b/MatrixSDK/Crypto/CryptoMachine/Extensions/MXRoomHistoryVisibility+HistoryVisibility.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension MXRoomHistoryVisibility { var visibility: HistoryVisibility { diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift index b92cd55f8a..3999f6cdc8 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto typealias GetRoomAction = (String) -> MXRoom? diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift index 65dee0f900..2a7e586627 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoProtocols.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// A set of protocols defining the functionality in `MatrixSDKCrypto` and separating them into logical units diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift index 5703725543..e4d111aba3 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoRequests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Convenience class to delegate network requests originating in Rust crypto module /// to the native REST API client diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift index 9c84ce7d78..57fff5b941 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoSDKLogger.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Redirects logs originating in `MatrixSDKCrypto` into `MXLog` class MXCryptoSDKLogger: Logger { diff --git a/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift b/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift index d85be87c63..28c432f35f 100644 --- a/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift +++ b/MatrixSDK/Crypto/Devices/Data/MXCryptoDeviceWrapper.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Convenience wrapper around `MatrixSDKCrypto`'s `Device` /// which can be used to create `MatrixSDK`s `MXDeviceInfo` diff --git a/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift b/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift index c7338e8bdc..8d62a63630 100644 --- a/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift +++ b/MatrixSDK/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngine.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCryptoKeyBackupEngine: NSObject, MXKeyBackupEngine { // Batch size chosen arbitrarily, will be moved to CryptoSDK diff --git a/MatrixSDK/Crypto/MXCryptoV2.swift b/MatrixSDK/Crypto/MXCryptoV2.swift index f700e7fd6d..1cf2aee9f9 100644 --- a/MatrixSDK/Crypto/MXCryptoV2.swift +++ b/MatrixSDK/Crypto/MXCryptoV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// An implementation of `MXCrypto` which uses [matrix-rust-sdk](https://github.com/matrix-org/matrix-rust-sdk/tree/main/crates/matrix-sdk-crypto) /// under the hood. diff --git a/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift b/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift index 6465ee00d9..6683ca0a7c 100644 --- a/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift +++ b/MatrixSDK/Crypto/Migration/Data/MXCryptoMigrationStore.swift @@ -15,8 +15,8 @@ // import Foundation -import OLMKit -import MatrixSDKCrypto +@_implementationOnly import OLMKit +@_implementationOnly import MatrixSDKCrypto struct MXCryptoMigrationStore { struct GlobalSettings { diff --git a/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift b/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift index 4368ad68ea..32d96c36a4 100644 --- a/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift +++ b/MatrixSDK/Crypto/Migration/MXCryptoMigrationV2.swift @@ -15,8 +15,8 @@ // import Foundation -import OLMKit -import MatrixSDKCrypto +@_implementationOnly import OLMKit +@_implementationOnly import MatrixSDKCrypto class MXCryptoMigrationV2: NSObject { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift b/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift index 42291c59a5..e68978e205 100644 --- a/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift +++ b/MatrixSDK/Crypto/Verification/MXKeyVerificationManagerV2.swift @@ -6,7 +6,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXKeyVerificationManagerV2: NSObject, MXKeyVerificationManager { enum Error: Swift.Error { diff --git a/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift b/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift index 24c701fc8d..9f54c3d5a9 100644 --- a/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift +++ b/MatrixSDK/Crypto/Verification/Requests/MXKeyVerificationRequestV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// Verification request originating from `MatrixSDKCrypto` class MXKeyVerificationRequestV2: NSObject, MXKeyVerificationRequest { diff --git a/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift b/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift index 5974c44354..0ecda52b60 100644 --- a/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift +++ b/MatrixSDK/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// QR transaction originating from `MatrixSDKCrypto` class MXQRCodeTransactionV2: NSObject, MXQRCodeTransaction { diff --git a/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift b/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift index f1d42a68d9..4468ae8f19 100644 --- a/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift +++ b/MatrixSDK/Crypto/Verification/Transactions/SAS/MXSASTransactionV2.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto /// SAS transaction originating from `MatrixSDKCrypto` class MXSASTransactionV2: NSObject, MXSASTransaction { diff --git a/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift b/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift index e3615dc3ce..601ad5b00e 100644 --- a/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift +++ b/MatrixSDK/Utils/Logs/MXAnalyticsDestination.swift @@ -6,7 +6,11 @@ // import Foundation +#if IS_TEST_RUN import SwiftyBeaver +#else +@_implementationOnly import SwiftyBeaver +#endif /// SwiftyBeaver log destination that sends errors to analytics tracker class MXAnalyticsDestination: BaseDestination { diff --git a/MatrixSDK/Utils/Logs/MXLog.swift b/MatrixSDK/Utils/Logs/MXLog.swift index c36bbc446d..acfa33bd96 100644 --- a/MatrixSDK/Utils/Logs/MXLog.swift +++ b/MatrixSDK/Utils/Logs/MXLog.swift @@ -15,7 +15,11 @@ // import Foundation +#if IS_TEST_RUN import SwiftyBeaver +#else +@_implementationOnly import SwiftyBeaver +#endif /// Various MXLog configuration options. Used in conjunction with `MXLog.configure()` @objc public class MXLogConfiguration: NSObject { diff --git a/MatrixSDK/Utils/Realm/RLMSupport.swift b/MatrixSDK/Utils/Realm/RLMSupport.swift index ab3c840ab9..e855317795 100644 --- a/MatrixSDK/Utils/Realm/RLMSupport.swift +++ b/MatrixSDK/Utils/Realm/RLMSupport.swift @@ -16,7 +16,7 @@ // //////////////////////////////////////////////////////////////////////////// -import Realm +@_implementationOnly import Realm extension RLMRealm { /** @@ -24,7 +24,7 @@ extension RLMRealm { - see: `+ [RLMRealm schemaVersionAtURL:encryptionKey:error:]` */ - @nonobjc public class func schemaVersion(at url: URL, usingEncryptionKey key: Data? = nil) throws -> UInt64 { + @nonobjc class func schemaVersion(at url: URL, usingEncryptionKey key: Data? = nil) throws -> UInt64 { var error: NSError? let version = __schemaVersion(at: url, encryptionKey: key, error: &error) guard version != RLMNotVersioned else { throw error! } @@ -38,7 +38,7 @@ extension RLMRealm { - see `- [RLMRealm resolveThreadSafeReference:]` */ - @nonobjc public func resolve(reference: RLMThreadSafeReference) -> Confined? { + @nonobjc func resolve(reference: RLMThreadSafeReference) -> Confined? { return __resolve(reference as! RLMThreadSafeReference) as! Confined? } } @@ -49,7 +49,7 @@ extension RLMObject { - see `+ [RLMObject objectsWithPredicate:]` */ - public class func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { + class func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { return objects(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults } @@ -58,7 +58,7 @@ extension RLMObject { - see `+ [RLMObject objectsInRealm:withPredicate:]` */ - public class func objects(in realm: RLMRealm, + class func objects(in realm: RLMRealm, where predicateFormat: String, _ args: CVarArg...) -> RLMResults { return objects(in: realm, with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults @@ -66,7 +66,7 @@ extension RLMObject { } /// A protocol defining iterator support for RLMArray, RLMSet & RLMResults. -public protocol _RLMCollectionIterator { +protocol _RLMCollectionIterator { /** Returns a `RLMCollectionIterator` that yields successive elements in the collection. This enables support for sequence-style enumeration of `RLMObject` subclasses in Swift. @@ -76,43 +76,44 @@ public protocol _RLMCollectionIterator { extension _RLMCollectionIterator where Self: RLMCollection { /// :nodoc: - public func makeIterator() -> RLMCollectionIterator { + func makeIterator() -> RLMCollectionIterator { return RLMCollectionIterator(self) } } /// :nodoc: -public typealias RLMDictionarySingleEntry = (key: String, value: RLMObject) +typealias RLMDictionarySingleEntry = (key: String, value: RLMObject) /// A protocol defining iterator support for RLMDictionary -public protocol _RLMDictionaryIterator { +protocol _RLMDictionaryIterator { /// :nodoc: func makeIterator() -> RLMDictionaryIterator } extension _RLMDictionaryIterator where Self: RLMCollection { /// :nodoc: - public func makeIterator() -> RLMDictionaryIterator { + func makeIterator() -> RLMDictionaryIterator { return RLMDictionaryIterator(self) } } // Sequence conformance for RLMArray, RLMDictionary, RLMSet and RLMResults is provided by RLMCollection's // `makeIterator()` implementation. -extension RLMArray: Sequence, _RLMCollectionIterator { } -extension RLMDictionary: Sequence, _RLMDictionaryIterator {} -extension RLMSet: Sequence, _RLMCollectionIterator {} -extension RLMResults: Sequence, _RLMCollectionIterator {} +// Disabled since `@_implementationOnly`-importing Realm prevents these extensions. Note that this makes this whole file basically useless. +//extension RLMArray: Sequence, _RLMCollectionIterator { } +//extension RLMDictionary: Sequence, _RLMDictionaryIterator {} +//extension RLMSet: Sequence, _RLMCollectionIterator {} +//extension RLMResults: Sequence, _RLMCollectionIterator {} /** This struct enables sequence-style enumeration for RLMObjects in Swift via `RLMCollection.makeIterator` */ -public struct RLMCollectionIterator: IteratorProtocol { +struct RLMCollectionIterator: IteratorProtocol { private var iteratorBase: NSFastEnumerationIterator internal init(_ collection: RLMCollection) { iteratorBase = NSFastEnumerationIterator(collection) } - public mutating func next() -> RLMObject? { + mutating func next() -> RLMObject? { return iteratorBase.next() as! RLMObject? } } @@ -120,7 +121,7 @@ public struct RLMCollectionIterator: IteratorProtocol { /** This struct enables sequence-style enumeration for RLMDictionary in Swift via `RLMDictionary.makeIterator` */ -public struct RLMDictionaryIterator: IteratorProtocol { +struct RLMDictionaryIterator: IteratorProtocol { private var iteratorBase: NSFastEnumerationIterator private let dictionary: RLMDictionary @@ -129,7 +130,7 @@ public struct RLMDictionaryIterator: IteratorProtocol { iteratorBase = NSFastEnumerationIterator(collection) } - public mutating func next() -> RLMDictionarySingleEntry? { + mutating func next() -> RLMDictionarySingleEntry? { let key = iteratorBase.next() if let key = key { return (key: key as Any, value: dictionary[key as AnyObject]) as? RLMDictionarySingleEntry @@ -146,7 +147,7 @@ extension RLMCollection { /** Returns the index of the first object in the collection matching the predicate. */ - public func indexOfObject(where predicateFormat: String, _ args: CVarArg...) -> UInt { + func indexOfObject(where predicateFormat: String, _ args: CVarArg...) -> UInt { guard let index = indexOfObject?(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) else { fatalError("This RLMCollection does not support indexOfObject(where:)") } @@ -156,14 +157,14 @@ extension RLMCollection { /** Returns all objects matching the given predicate in the collection. */ - public func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { + func objects(where predicateFormat: String, _ args: CVarArg...) -> RLMResults { return objects(with: NSPredicate(format: predicateFormat, arguments: getVaList(args))) as! RLMResults } } extension RLMCollection { /// Allows for subscript support with RLMDictionary. - public subscript(_ key: String) -> AnyObject? { + subscript(_ key: String) -> AnyObject? { get { (self as! RLMDictionary).object(forKey: key as NSString) } diff --git a/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift b/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift index 434aa6782d..45e1f18678 100644 --- a/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift +++ b/MatrixSDK/Utils/Realm/Realm+MatrixSDK.swift @@ -14,7 +14,7 @@ // limitations under the License. // -import Realm +@_implementationOnly import Realm extension RLMRealm { diff --git a/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift b/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift index 344f49e0d2..ccd66c9715 100644 --- a/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift +++ b/MatrixSDKTests/Crypto/Algorithms/Megolm/MXMegolmDecryptionUnitTests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXMegolmDecryptionUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift index f2eb25723b..d28626cef2 100644 --- a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift +++ b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventDecryptionUnitTests.swift @@ -17,7 +17,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXRoomEventDecryptionUnitTests: XCTestCase { class DecryptorStub: CryptoIdentityStub, MXCryptoRoomEventDecrypting { diff --git a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift index 8dc292a901..5812aa554b 100644 --- a/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift +++ b/MatrixSDKTests/Crypto/Algorithms/RoomEvents/MXRoomEventEncryptionUnitTests.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXRoomEventEncryptionUnitTests: XCTestCase { class StateStub: MXRoomState { diff --git a/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift b/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift index 7f01767846..1e630e6a1e 100644 --- a/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift +++ b/MatrixSDKTests/Crypto/CrossSigning/Data/MXCrossSigningInfoUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCrossSigningInfoUnitTests: XCTestCase { func makeKey(type: String, user: String) -> MXCrossSigningKey { diff --git a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift index 4ed6168f50..1a7261f384 100644 --- a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift +++ b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningInfoSourceUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCrossSigningInfoSourceUnitTests: XCTestCase { var cryptoSource: UserIdentitySourceStub! diff --git a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift index fd5fcc2fee..b053232708 100644 --- a/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/CrossSigning/MXCrossSigningV2UnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCrossSigningV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift b/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift index 5c77c80896..52edc33f3f 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/DecryptedEvent+Stub.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension DecryptedEvent { static func stub( diff --git a/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift b/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift index 2b5cb493ff..edd4ec326a 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/Device+Stub.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto extension Device { static func stub( diff --git a/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift b/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift index 8bcae0ddf4..f26a068c15 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/Extensions/EventEncryptionAlgorithmUnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class EventEncryptionAlgorithmUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift index 0ef92ebcf3..48308b2dce 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoMachineUnitTests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXCryptoMachineUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift index 570e35d392..073559d956 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoProtocolStubs.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -@testable import MatrixSDKCrypto +@_implementationOnly @testable import MatrixSDKCrypto class CryptoIdentityStub: MXCryptoIdentity { var userId: String = "Alice" diff --git a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift index 16d697fe4a..384d9346d8 100644 --- a/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift +++ b/MatrixSDKTests/Crypto/CryptoMachine/MXCryptoRequestsUnitTests.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCryptoRequestsUnitTests: XCTestCase { func test_canCreateToDeviceRequest() { diff --git a/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift b/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift index 2b1c240c56..97c53ba0e0 100644 --- a/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift +++ b/MatrixSDKTests/Crypto/Data/Store/MXMemoryCryptoStore.swift @@ -15,7 +15,7 @@ // import Foundation -import OLMKit +@_implementationOnly import OLMKit public class MXMemoryCryptoStore: NSObject, MXCryptoStore { diff --git a/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift b/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift index abdf3ba911..44e0c1a5cd 100644 --- a/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift +++ b/MatrixSDKTests/Crypto/Devices/Data/MXDeviceInfoUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXDeviceInfoUnitTests: XCTestCase { func test_canCreateInfo_withDevice() { diff --git a/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift b/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift index 163ce55228..1a65e652d2 100644 --- a/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift +++ b/MatrixSDKTests/Crypto/Devices/MXDeviceInfoSourceUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXDeviceInfoSourceUnitTests: XCTestCase { var cryptoSource: DevicesSourceStub! diff --git a/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift b/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift index ba9271fe0b..196c8ac7d1 100644 --- a/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift +++ b/MatrixSDKTests/Crypto/KeyBackup/Engine/MXCryptoKeyBackupEngineUnitTests.swift @@ -16,7 +16,7 @@ import Foundation @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXCryptoKeyBackupEngineUnitTests: XCTestCase { actor DecryptorSpy: MXRoomEventDecrypting { diff --git a/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift b/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift index 1197fc26ff..09998e6cdb 100644 --- a/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift +++ b/MatrixSDKTests/Crypto/Migration/Data/MXCryptoMigrationStoreUnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXCryptoMigrationStoreUnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift b/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift index dc53091a9f..04e704c52c 100644 --- a/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift +++ b/MatrixSDKTests/Crypto/Trust/MXTrustLevelSourceUnitTests.swift @@ -17,7 +17,7 @@ import Foundation import XCTest @testable import MatrixSDK -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class MXTrustLevelSourceUnitTests: XCTestCase { var userIdentitySource: UserIdentitySourceStub! diff --git a/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift b/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift index 4854950d36..9fef0c06b2 100644 --- a/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Verification/Requests/MXKeyVerificationRequestV2UnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXKeyVerificationRequestV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift b/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift index 730eaeb6d9..5a48049af1 100644 --- a/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Requests/VerificationRequestStub.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto class VerificationRequestStub: VerificationRequestProtocol { diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift index 61bf513aeb..c3fc00dde1 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/MXQRCodeTransactionV2UnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXQRCodeTransactionV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift index 15fe3df825..29c1c88b3b 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/QRCode/QrCodeStub.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto struct QrCodeStub: QrCodeProtocol { private let _otherUserId: String diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift index fa45ff94a2..6aa81859ba 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/MXSASTransactionV2UnitTests.swift @@ -16,7 +16,7 @@ import Foundation import XCTest -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXSASTransactionV2UnitTests: XCTestCase { diff --git a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift index ed81168ef1..1a738ecc44 100644 --- a/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift +++ b/MatrixSDKTests/Crypto/Verification/Transactions/SAS/SasStub.swift @@ -16,7 +16,7 @@ import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto struct SasStub: SasProtocol { diff --git a/changelog.d/sdk-1497.build b/changelog.d/sdk-1497.build new file mode 100644 index 0000000000..2f7fc863ad --- /dev/null +++ b/changelog.d/sdk-1497.build @@ -0,0 +1 @@ +Build: Makes distributing the SDK as a binary Swift package possible again. Contributed by Christopher Kobusch (@Topheee). From 09abbfa9d42be704a6539d05e9086fa8716012e6 Mon Sep 17 00:00:00 2001 From: Christopher Kobusch Date: Sat, 23 Sep 2023 22:54:07 +0200 Subject: [PATCH 2/4] add @_implementationOnly to new files --- MatrixSDK/Crypto/Dehydration/DehydrationService.swift | 2 +- .../Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift | 2 +- .../Crypto/Migration/MXCryptoMigrationV2UnitTests.swift | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift index 6f4ccb9c77..0c2902a28d 100644 --- a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift +++ b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto enum DehydrationServiceError: Error { case failedDehydration(Error) diff --git a/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift b/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift index 4510c3a782..4c337d57ff 100644 --- a/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift +++ b/MatrixSDKTests/Crypto/Migration/LegacyRealmStore/LegacyRealmStore.swift @@ -15,7 +15,7 @@ // import Foundation -import Realm +@_implementationOnly import Realm /// Class simulating legacy crypto store associated with the now-deprecated native crypto module /// diff --git a/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift b/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift index 88b5cfc676..ddea7c1834 100644 --- a/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift +++ b/MatrixSDKTests/Crypto/Migration/MXCryptoMigrationV2UnitTests.swift @@ -15,7 +15,7 @@ // import Foundation -import MatrixSDKCrypto +@_implementationOnly import MatrixSDKCrypto @testable import MatrixSDK class MXCryptoMigrationV2UnitTests: XCTestCase { From 8da77d34f84667973b5c02fa253d9d0bb52cdcd0 Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 7 Feb 2024 11:03:33 +0200 Subject: [PATCH 3/4] version++ --- CHANGES.md | 5 +++++ MatrixSDK.podspec | 2 +- MatrixSDK/MatrixSDKVersion.m | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index a9e708f354..404ac4b973 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,3 +1,8 @@ +## Changes in 0.27.6 (2024-02-07) + +No significant changes. + + ## Changes in 0.27.5 (2024-01-09) 🐛 Bugfixes diff --git a/MatrixSDK.podspec b/MatrixSDK.podspec index c0ccd57631..84c8b1b3df 100644 --- a/MatrixSDK.podspec +++ b/MatrixSDK.podspec @@ -1,7 +1,7 @@ Pod::Spec.new do |s| s.name = "MatrixSDK" - s.version = "0.27.5" + s.version = "0.27.6" s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)" s.description = <<-DESC diff --git a/MatrixSDK/MatrixSDKVersion.m b/MatrixSDK/MatrixSDKVersion.m index 79f6a20957..3f16e20dca 100644 --- a/MatrixSDK/MatrixSDKVersion.m +++ b/MatrixSDK/MatrixSDKVersion.m @@ -16,4 +16,4 @@ #import -NSString *const MatrixSDKVersion = @"0.27.5"; +NSString *const MatrixSDKVersion = @"0.27.6"; From 184b907088361839e2e61ca94f639ebd3e87961a Mon Sep 17 00:00:00 2001 From: Stefan Ceriu Date: Wed, 7 Feb 2024 12:33:15 +0200 Subject: [PATCH 4/4] finish version++