diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ff5df7f4e..c32b2e917 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,10 +42,10 @@ jobs: name: "tvOS" scheme: "Flare" sdk: appletvsimulator - - destination: "OS=9.1,name=Apple Watch Series 8 (45mm)" - name: "watchOS" - scheme: "Flare" - sdk: watchsimulator + # - destination: "OS=9.1,name=Apple Watch Series 8 (45mm)" + # name: "watchOS" + # scheme: "Flare" + # sdk: watchsimulator - destination: "platform=macOS" name: "macOS" scheme: "Flare" diff --git a/Makefile b/Makefile index 856d64b45..55d969d56 100644 --- a/Makefile +++ b/Makefile @@ -16,4 +16,7 @@ lint: fmt: mint run swiftformat Sources Tests -.PHONY: all bootstrap hook mint lint fmt \ No newline at end of file +generate: + xcodegen generate + +.PHONY: all bootstrap hook mint lint fmt generate \ No newline at end of file diff --git a/Tests/FlareTests/UnitTestHostApp/AppDelegate.swift b/Tests/FlareTests/UnitTestHostApp/AppDelegate.swift index 603d7aff0..eb5f98aae 100644 --- a/Tests/FlareTests/UnitTestHostApp/AppDelegate.swift +++ b/Tests/FlareTests/UnitTestHostApp/AppDelegate.swift @@ -5,7 +5,7 @@ import SwiftUI -#if os(watchOS) || os(tvOS) +#if os(watchOS) || os(tvOS) || os(macOS) @main struct TestApp: App { @@ -17,7 +17,6 @@ import SwiftUI } #else - // Scene isn't available until iOS 14.0, so this is for backwards compatibility. @main diff --git a/Tests/FlareTests/UnitTestHostApp/Info.plist b/Tests/FlareTests/UnitTestHostApp/Info.plist index 8a7dc9a70..ceae02525 100644 --- a/Tests/FlareTests/UnitTestHostApp/Info.plist +++ b/Tests/FlareTests/UnitTestHostApp/Info.plist @@ -17,7 +17,7 @@ CFBundlePackageType $(PRODUCT_BUNDLE_PACKAGE_TYPE) CFBundleShortVersionString - 4.32.0 + 1 CFBundleVersion 1 LSRequiresIPhoneOS diff --git a/Tests/FlareTests/UnitTests/FlareTests.swift b/Tests/FlareTests/UnitTests/FlareTests.swift index 6f97ebb93..d2c186fcb 100644 --- a/Tests/FlareTests/UnitTests/FlareTests.swift +++ b/Tests/FlareTests/UnitTests/FlareTests.swift @@ -242,6 +242,7 @@ class FlareTests: StoreSessionTestCase { } #endif + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) func test_thatFlarePurchasesAProductWithOptions_whenPurchaseCompleted() async throws { let transaction = StoreTransactionStub() try await test_purchaseWithOptionsAndCompletion( @@ -251,6 +252,7 @@ class FlareTests: StoreSessionTestCase { ) } + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) func test_thatFlarePurchaseThrowsAnError_whenPaymentNotAllowed() async throws { try await test_purchaseWithOptionsAndCompletion( canMakePayments: false, @@ -258,6 +260,7 @@ class FlareTests: StoreSessionTestCase { ) } + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) func test_thatFlarePurchasesAsyncAProductWithOptionsAndCompletionHandler_whenPurchaseCompleted() async throws { let transaction = StoreTransactionStub() try await test_purchaseWithOptions( @@ -266,6 +269,7 @@ class FlareTests: StoreSessionTestCase { ) } + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) func test_thatFlarePurchaseAsyncThrowsAnError_whenPaymentNotAllowed() async throws { try await test_purchaseWithOptions( canMakePayments: false, @@ -275,6 +279,7 @@ class FlareTests: StoreSessionTestCase { // MARK: Private + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) private func test_purchaseWithOptionsAndCompletion( transaction: StoreTransactionStub? = nil, canMakePayments: Bool, @@ -302,6 +307,7 @@ class FlareTests: StoreSessionTestCase { XCTAssertEqual(result, expectedResult) } + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) private func test_purchaseWithOptions( transaction: StoreTransactionStub? = nil, canMakePayments: Bool, diff --git a/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift b/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift index 63c967817..5689faee8 100644 --- a/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift +++ b/Tests/FlareTests/UnitTests/Providers/IAPProviderTests.swift @@ -292,6 +292,7 @@ class IAPProviderTests: XCTestCase { } #endif + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) func test_thatIAPProviderPurchasesAProduct() async throws { // given let transactionMock = StoreTransactionMock() @@ -309,6 +310,7 @@ class IAPProviderTests: XCTestCase { XCTAssertEqual(transaction.transactionIdentifier, .transactionID) } + @available(iOS 15.0, tvOS 15.0, macOS 12.0, watchOS 8.0, *) func test_thatIAPProviderPurchasesAProductWithOptions() async throws { // given let transactionMock = StoreTransactionMock() diff --git a/project.yml b/project.yml index 2b6101e38..25419d99a 100644 --- a/project.yml +++ b/project.yml @@ -1,4 +1,10 @@ name: Flare +options: + deploymentTarget: + iOS: 13.0 + macOS: 10.15 + tvOS: 13.0 + watchOS: 7.0 packages: # External @@ -8,23 +14,18 @@ packages: ObjectsFactory: url: https://github.com/space-code/objects-factory.git from: 1.0.0 - - # Flare: - # path: . - targets: UnitTestHostApp: type: application - supportedDestinations: [iOS, tvOS, macOS, watchOS] + supportedDestinations: [iOS, tvOS, macOS] sources: Tests/FlareTests/UnitTestHostApp settings: base: PRODUCT_BUNDLE_IDENTIFIER: com.spacecode.flare + DEVELOPMENT_TEAM: A8WE5LL2GU scheme: testTargets: - FlareTests - # dependencies: - # - package: Flare Flare: type: framework supportedDestinations: [iOS, tvOS, macOS, watchOS] @@ -44,7 +45,6 @@ targets: FlareTests: type: bundle.unit-test supportedDestinations: [iOS, tvOS, macOS, watchOS] - # targets: ["1"] dependencies: - package: Concurrency product: TestConcurrency