diff --git a/Package@swift-5.6.swift b/Package@swift-5.6.swift deleted file mode 100644 index e00eccd061..0000000000 --- a/Package@swift-5.6.swift +++ /dev/null @@ -1,56 +0,0 @@ -// swift-tools-version:5.6 -// The swift-tools-version declares the minimum version of Swift required to build this package. - -import PackageDescription -import class Foundation.ProcessInfo - -// Only add DocC Plugin when building docs, so that clients of this library won't -// unnecessarily also get the DocC Plugin -let environmentVariables = ProcessInfo.processInfo.environment -let shouldIncludeDocCPlugin = environmentVariables["INCLUDE_DOCC_PLUGIN"] == "true" - -var dependencies: [Package.Dependency] = [ - .package(url: "git@github.com:Quick/Nimble.git", from: "10.0.0") -] -if shouldIncludeDocCPlugin { - dependencies.append(.package(url: "https://github.com/apple/swift-docc-plugin", from: "1.0.0")) -} - -let package = Package( - name: "RevenueCat", - platforms: [ - .macOS(.v10_13), - .watchOS("6.2"), - .tvOS(.v11), - .iOS(.v11) - ], - products: [ - .library(name: "RevenueCat", - targets: ["RevenueCat"]), - .library(name: "RevenueCat_CustomEntitlementComputation", - targets: ["RevenueCat_CustomEntitlementComputation"]), - .library(name: "ReceiptParser", - targets: ["ReceiptParser"]) - ], - dependencies: dependencies, - targets: [ - .target(name: "RevenueCat", - path: "Sources", - exclude: ["Info.plist", "LocalReceiptParsing/ReceiptParser-only-files"], - resources: [ - .copy("../Sources/PrivacyInfo.xcprivacy") - ]), - .target(name: "RevenueCat_CustomEntitlementComputation", - path: "CustomEntitlementComputation", - exclude: ["Info.plist", "LocalReceiptParsing/ReceiptParser-only-files"], - resources: [ - .copy("PrivacyInfo.xcprivacy") - ], - swiftSettings: [.define("ENABLE_CUSTOM_ENTITLEMENT_COMPUTATION")]), - .target(name: "ReceiptParser", - path: "LocalReceiptParsing"), - .testTarget(name: "ReceiptParserTests", - dependencies: ["ReceiptParser", "Nimble"], - exclude: ["ReceiptParserTests-Info.plist"]) - ] -) diff --git a/Sources/Identity/CustomerInfo.swift b/Sources/Identity/CustomerInfo.swift index 875394c5c0..99e1838cb4 100644 --- a/Sources/Identity/CustomerInfo.swift +++ b/Sources/Identity/CustomerInfo.swift @@ -272,14 +272,7 @@ extension CustomerInfo: RawDataContainer { } -#if swift(>=5.7) extension CustomerInfo: Sendable {} -#else -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -// - `URL` is not `Sendable` until Swift 5.7 -extension CustomerInfo: @unchecked Sendable {} -#endif /// `CustomerInfo`'s `Codable` implementation relies on `Data` extension CustomerInfo: Codable { diff --git a/Sources/LocalReceiptParsing/BasicTypes/AppleReceipt.swift b/Sources/LocalReceiptParsing/BasicTypes/AppleReceipt.swift index 18b61aaef7..3e73d3c1a4 100644 --- a/Sources/LocalReceiptParsing/BasicTypes/AppleReceipt.swift +++ b/Sources/LocalReceiptParsing/BasicTypes/AppleReceipt.swift @@ -64,13 +64,7 @@ public struct AppleReceipt: Equatable { } -#if swift(>=5.7) extension AppleReceipt: Sendable {} -#else -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -extension AppleReceipt: @unchecked Sendable {} -#endif // MARK: - Extensions diff --git a/Sources/LocalReceiptParsing/BasicTypes/InAppPurchase.swift b/Sources/LocalReceiptParsing/BasicTypes/InAppPurchase.swift index b6e1c5aecf..b7fe9ae377 100644 --- a/Sources/LocalReceiptParsing/BasicTypes/InAppPurchase.swift +++ b/Sources/LocalReceiptParsing/BasicTypes/InAppPurchase.swift @@ -193,13 +193,7 @@ extension AppleReceipt.InAppPurchase { extension AppleReceipt.InAppPurchase.ProductType: Sendable {} -#if swift(>=5.7) extension AppleReceipt.InAppPurchase: Sendable {} -#else -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -extension AppleReceipt.InAppPurchase: @unchecked Sendable {} -#endif extension AppleReceipt.InAppPurchase.ProductType: Codable {} extension AppleReceipt.InAppPurchase: Codable {} diff --git a/Sources/Misc/Concurrency/Lock.swift b/Sources/Misc/Concurrency/Lock.swift index da3e299b87..32c61b62d1 100644 --- a/Sources/Misc/Concurrency/Lock.swift +++ b/Sources/Misc/Concurrency/Lock.swift @@ -26,12 +26,7 @@ internal final class Lock { } - #if swift(>=5.7) private typealias UnderlyingType = NSLocking & Sendable - #else - // `NSRecursiveLock` and `NSLock` aren't `Sendable` until iOS 16.0 / Swift 5.7 - private typealias UnderlyingType = NSLocking - #endif private let lock: UnderlyingType private init(_ lock: UnderlyingType) { self.lock = lock } @@ -51,12 +46,7 @@ internal final class Lock { } -#if swift(>=5.7) extension Lock: Sendable {} -#else -// `Lock.UnderlyingType` isn't `Sendable` until Swift 5.7 -extension Lock: @unchecked Sendable {} -#endif private extension Lock.LockType { diff --git a/Sources/Misc/SystemInfo.swift b/Sources/Misc/SystemInfo.swift index 22423aa6e0..85f602674f 100644 --- a/Sources/Misc/SystemInfo.swift +++ b/Sources/Misc/SystemInfo.swift @@ -269,9 +269,6 @@ private extension SystemInfo { return Bundle.main.infoDictionary?.keys.contains("WKApplication") == true } - // In Xcode 14 and later, you can produce watchOS apps with a single watchOS app target. - // These single-target watchOS apps can run on watchOS 7 and later. - #if swift(>=5.7) if #available(watchOS 7.0, *), self.isOperatingSystemAtLeast(.init(majorVersion: 9, minorVersion: 0, patchVersion: 0)) { @@ -288,15 +285,6 @@ private extension SystemInfo { return WKExtension.shared().applicationState == .background } } - #else - // In Xcode 13 and earlier the system divides a watchOS app into two sections - // (single-target apps are not supported): - // - WatchKit app - // - WatchKit extension - - // Before Xcode 14, single-target extensions aren't supported (and `WKApplication` isn't available) - return WKExtension.shared().applicationState == .background - #endif } #endif diff --git a/Sources/Purchasing/CachingProductsManager.swift b/Sources/Purchasing/CachingProductsManager.swift index b4baffb51d..508ec5d0ed 100644 --- a/Sources/Purchasing/CachingProductsManager.swift +++ b/Sources/Purchasing/CachingProductsManager.swift @@ -22,13 +22,8 @@ final class CachingProductsManager { private let productCache: Atomic<[String: StoreProduct]> = .init([:]) private let requestCache: Atomic<[Set: [Completion]]> = .init([:]) - #if swift(>=5.7) private let _sk2ProductCache: (any Sendable)? private let _sk2RequestCache: (any Sendable)? - #else - private let _sk2ProductCache: Any? - private let _sk2RequestCache: Any? - #endif @available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) private var sk2ProductCache: Atomic<[String: SK2StoreProduct]> { diff --git a/Sources/Purchasing/EntitlementInfo.swift b/Sources/Purchasing/EntitlementInfo.swift index 285d64d9bb..59eca98573 100644 --- a/Sources/Purchasing/EntitlementInfo.swift +++ b/Sources/Purchasing/EntitlementInfo.swift @@ -340,10 +340,4 @@ private extension EntitlementInfo { } -#if swift(>=5.7) extension EntitlementInfo.Contents: Sendable {} -#else -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -extension EntitlementInfo.Contents: @unchecked Sendable {} -#endif diff --git a/Sources/Purchasing/NonSubscriptionTransaction.swift b/Sources/Purchasing/NonSubscriptionTransaction.swift index a4e55a4a37..72705af283 100644 --- a/Sources/Purchasing/NonSubscriptionTransaction.swift +++ b/Sources/Purchasing/NonSubscriptionTransaction.swift @@ -62,10 +62,4 @@ public final class NonSubscriptionTransaction: NSObject { } -#if swift(>=5.7) extension NonSubscriptionTransaction: Sendable {} -#else -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -extension NonSubscriptionTransaction: @unchecked Sendable {} -#endif diff --git a/Sources/Purchasing/ProductsManager.swift b/Sources/Purchasing/ProductsManager.swift index 70d3c8e984..f5a8b944ef 100644 --- a/Sources/Purchasing/ProductsManager.swift +++ b/Sources/Purchasing/ProductsManager.swift @@ -52,11 +52,7 @@ class ProductsManager: NSObject, ProductsManagerType { private let productsFetcherSK1: ProductsFetcherSK1 private let systemInfo: SystemInfo -#if swift(>=5.7) private let _productsFetcherSK2: (any Sendable)? -#else - private let _productsFetcherSK2: Any? -#endif @available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) private var productsFetcherSK2: ProductsFetcherSK2 { diff --git a/Sources/Purchasing/StoreKit2/StoreKit2TransactionListener.swift b/Sources/Purchasing/StoreKit2/StoreKit2TransactionListener.swift index cac832a374..dada7b4029 100644 --- a/Sources/Purchasing/StoreKit2/StoreKit2TransactionListener.swift +++ b/Sources/Purchasing/StoreKit2/StoreKit2TransactionListener.swift @@ -60,18 +60,9 @@ actor StoreKit2TransactionListener: StoreKit2TransactionListenerType { private weak var delegate: StoreKit2TransactionListenerDelegate? private let updates: AsyncStream - #if swift(<5.7) - // Note that these 2 constructors are duplicated because - // not having convinience here is an error in Xcode 13 - // But having it is an error in Xcode 14. - convenience init(delegate: StoreKit2TransactionListenerDelegate? = nil) { - self.init(delegate: delegate, updates: StoreKit.Transaction.updates) - } - #else init(delegate: StoreKit2TransactionListenerDelegate? = nil) { self.init(delegate: delegate, updates: StoreKit.Transaction.updates) } - #endif /// Creates a listener with an `AsyncSequence` of `VerificationResult`s /// By default `StoreKit.Transaction.updates` is used, but a custom one can be passed for testing. diff --git a/Sources/Purchasing/StoreKitAbstractions/PromotionalOffer.swift b/Sources/Purchasing/StoreKitAbstractions/PromotionalOffer.swift index 96e6d9d61a..40f31d73c4 100644 --- a/Sources/Purchasing/StoreKitAbstractions/PromotionalOffer.swift +++ b/Sources/Purchasing/StoreKitAbstractions/PromotionalOffer.swift @@ -92,13 +92,7 @@ extension PromotionalOffer: Sendable {} } -#if swift(>=5.7) extension PromotionalOffer.SignedData: Sendable {} -#else -// `@unchecked` because: -// - `UUID` is not `Sendable` until Swift 5.7 -extension PromotionalOffer.SignedData: @unchecked Sendable {} -#endif extension PromotionalOffer.SignedData { diff --git a/Sources/Purchasing/StoreKitAbstractions/SK1StoreProduct.swift b/Sources/Purchasing/StoreKitAbstractions/SK1StoreProduct.swift index 5e16279dc8..824887c72c 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK1StoreProduct.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK1StoreProduct.swift @@ -96,8 +96,3 @@ extension SK1StoreProduct: Hashable { } } - -#if swift(<5.7) -// `SK1Product` isn't `Sendable` until iOS 16.0 / Swift 5.7 -extension SK1StoreProduct: @unchecked Sendable {} -#endif diff --git a/Sources/Purchasing/StoreKitAbstractions/SK1StoreProductDiscount.swift b/Sources/Purchasing/StoreKitAbstractions/SK1StoreProductDiscount.swift index 59df0d6139..191920cdee 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK1StoreProductDiscount.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK1StoreProductDiscount.swift @@ -61,12 +61,6 @@ internal struct SK1StoreProductDiscount: StoreProductDiscountType { } -#if swift(<5.7) -// `SK1ProductDiscount` isn't `Sendable` until iOS 16.0 / Swift 5.7 -@available(iOS 11.2, macOS 10.13.2, tvOS 11.2, watchOS 6.2, *) -extension SK1StoreProductDiscount: @unchecked Sendable {} -#endif - // MARK: - Private private extension StoreProductDiscount.PaymentMode { diff --git a/Sources/Purchasing/StoreKitAbstractions/SK1StoreTransaction.swift b/Sources/Purchasing/StoreKitAbstractions/SK1StoreTransaction.swift index 7b32277859..4a20357222 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK1StoreTransaction.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK1StoreTransaction.swift @@ -91,10 +91,3 @@ extension SKPaymentTransaction { } } - -#if swift(<5.7) -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -// - `SK1Transaction` is not `Sendable` until Swift 5.7 -extension SK1StoreTransaction: @unchecked Sendable {} -#endif diff --git a/Sources/Purchasing/StoreKitAbstractions/SK1Storefront.swift b/Sources/Purchasing/StoreKitAbstractions/SK1Storefront.swift index 944519641d..40ec0b1000 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK1Storefront.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK1Storefront.swift @@ -29,9 +29,3 @@ internal struct SK1Storefront: StorefrontType { let countryCode: String } - -#if swift(<5.7) -// `SKStorefront` isn't `Sendable` until iOS 16.0 / Swift 5.7 -@available(iOS 13.0, macOS 10.15, tvOS 13.0, watchOS 6.2, macCatalyst 13.1, *) -extension SK1Storefront: @unchecked Sendable {} -#endif diff --git a/Sources/Purchasing/StoreKitAbstractions/SK2StoreProduct.swift b/Sources/Purchasing/StoreKitAbstractions/SK2StoreProduct.swift index 14c1e2bb88..9d508e104a 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK2StoreProduct.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK2StoreProduct.swift @@ -128,9 +128,3 @@ extension SK2StoreProduct: Hashable { } } - -#if swift(<5.7) -// `SK2Product` isn't `Sendable` until iOS 16.0 / Swift 5.7 -@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) -extension SK2StoreProduct: @unchecked Sendable {} -#endif diff --git a/Sources/Purchasing/StoreKitAbstractions/SK2StoreProductDiscount.swift b/Sources/Purchasing/StoreKitAbstractions/SK2StoreProductDiscount.swift index ad47401472..0d78247b84 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK2StoreProductDiscount.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK2StoreProductDiscount.swift @@ -46,12 +46,6 @@ internal struct SK2StoreProductDiscount: StoreProductDiscountType { var localizedPriceString: String { underlyingSK2Discount.displayPrice } } -#if swift(<5.7) -// `SK2ProductDiscount` isn't `Sendable` until iOS 16.0 / Swift 5.7 -@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) -extension SK2StoreProductDiscount: @unchecked Sendable {} -#endif - // MARK: - Private private extension StoreProductDiscount.PaymentMode { diff --git a/Sources/Purchasing/StoreKitAbstractions/SK2StoreTransaction.swift b/Sources/Purchasing/StoreKitAbstractions/SK2StoreTransaction.swift index c65a5046fc..b488fdac1d 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK2StoreTransaction.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK2StoreTransaction.swift @@ -53,11 +53,3 @@ internal struct SK2StoreTransaction: StoreTransactionType { } } - -#if swift(<5.7) -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -// - `SK2Transaction` is not `Sendable` until Swift 5.7 -@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) -extension SK2StoreTransaction: @unchecked Sendable {} -#endif diff --git a/Sources/Purchasing/StoreKitAbstractions/SK2Storefront.swift b/Sources/Purchasing/StoreKitAbstractions/SK2Storefront.swift index 11b3a5583d..278b1cf127 100644 --- a/Sources/Purchasing/StoreKitAbstractions/SK2Storefront.swift +++ b/Sources/Purchasing/StoreKitAbstractions/SK2Storefront.swift @@ -29,9 +29,3 @@ internal struct SK2Storefront: StorefrontType { let countryCode: String } - -#if swift(<5.7) -// `SKStorefront` isn't `Sendable` until iOS 16.0 / Swift 5.7 -@available(iOS 15.0, tvOS 15.0, watchOS 8.0, macOS 12.0, *) -extension SK2Storefront: @unchecked Sendable {} -#endif diff --git a/Tests/UnitTests/Mocks/MockStoreTransaction.swift b/Tests/UnitTests/Mocks/MockStoreTransaction.swift index 9afbc32997..3809895bfc 100644 --- a/Tests/UnitTests/Mocks/MockStoreTransaction.swift +++ b/Tests/UnitTests/Mocks/MockStoreTransaction.swift @@ -64,9 +64,3 @@ final class MockStoreTransaction: StoreTransactionType { } } - -#if swift(<5.7) -// `@unchecked` because: -// - `Date` is not `Sendable` until Swift 5.7 -extension MockStoreTransaction: @unchecked Sendable {} -#endif