Skip to content

Commit

Permalink
PurchaseTester: fixed watchOS build
Browse files Browse the repository at this point in the history
Fixes https://app.circleci.com/pipelines/github/RevenueCat/purchases-ios/12159/workflows/89db4b5d-bafc-4b99-ac86-4f205e49f1bf/jobs/81368

We were not correctly embedding (and therefore building) the `watchOS` extension until #2685. That exposed a bunch of other issues which this fixes.
  • Loading branch information
NachoSoto committed Jun 23, 2023
1 parent 984b231 commit d1949e0
Show file tree
Hide file tree
Showing 10 changed files with 29 additions and 19 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@
"idiom" : "mac",
"scale" : "2x",
"size" : "512x512"
},
{
"filename" : "App_store_1024_1x 1.png",
"idiom" : "universal",
"platform" : "watchos",
"size" : "1024x1024"
}
],
"info" : {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
4F1F5E9B2A18124C00C4EB88 /* ProxyViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F1F5E9A2A18124C00C4EB88 /* ProxyViewModel.swift */; };
4F1F5E9D2A1814EF00C4EB88 /* ProxyView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F1F5E9C2A1814EF00C4EB88 /* ProxyView.swift */; };
4F4F782F2A18542200689BAA /* LocalizedAlertError.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F4F782E2A18542200689BAA /* LocalizedAlertError.swift */; };
4F7EB8C12A460FB900242CF0 /* AppIcon.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 57E9CF08290B0BE500EE12D1 /* AppIcon.xcassets */; };
4F942FA82A449156007D0346 /* AdaptiveStack.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4F942FA72A449156007D0346 /* AdaptiveStack.swift */; };
4FDA13872A33DBE300C45CFE /* PrivacyInfo.xcprivacy in Resources */ = {isa = PBXBuildFile; fileRef = 4FDA13862A33DBE300C45CFE /* PrivacyInfo.xcprivacy */; };
575642A4290C7A2700719219 /* LoggerView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 575642A3290C7A2700719219 /* LoggerView.swift */; };
Expand Down Expand Up @@ -482,6 +483,7 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
4F7EB8C12A460FB900242CF0 /* AppIcon.xcassets in Resources */,
578DAA102947DD21001700FD /* Assets.xcassets in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
Expand Down Expand Up @@ -748,13 +750,13 @@
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match Development com.revenuecat.sampleapp";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "match Development com.revenuecat.sampleapp macos";
"PROVISIONING_PROFILE_SPECIFIER[sdk=watchos*]" = "match Development com.revenuecat.sampleapp";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4,6";
TARGETED_DEVICE_FAMILY = "1,2,3,6";
};
name = Debug;
};
Expand Down Expand Up @@ -790,13 +792,13 @@
"PROVISIONING_PROFILE_SPECIFIER[sdk=iphoneos*]" = "match AppStore com.revenuecat.sampleapp";
"PROVISIONING_PROFILE_SPECIFIER[sdk=macosx*]" = "match AppStore com.revenuecat.sampleapp macos";
"PROVISIONING_PROFILE_SPECIFIER[sdk=watchos*]" = "match AppStore com.revenuecat.sampleapp";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx watchos watchsimulator xros xrsimulator";
SUPPORTED_PLATFORMS = "appletvos appletvsimulator iphoneos iphonesimulator macosx xros xrsimulator";
SUPPORTS_MACCATALYST = YES;
SUPPORTS_MAC_DESIGNED_FOR_IPHONE_IPAD = NO;
SUPPORTS_XR_DESIGNED_FOR_IPHONE_IPAD = NO;
SWIFT_EMIT_LOC_STRINGS = YES;
SWIFT_VERSION = 5.0;
TARGETED_DEVICE_FAMILY = "1,2,3,4,6";
TARGETED_DEVICE_FAMILY = "1,2,3,6";
VALIDATE_PRODUCT = YES;
};
name = Release;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
shouldUseLaunchSchemeArgsEnv = "YES">
<Testables>
<TestableReference
skipped = "NO">
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "2CD2C501278C9B02005D1CC2"
BuildableName = "Tests iOS.xctest"
BlueprintName = "Tests iOS"
ReferencedContainer = "container:PurchaseTester.xcodeproj">
</BuildableReference>
</TestableReference>
</Testables>
</TestAction>
<LaunchAction
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@ struct PurchaseTesterApp: App {
private static var toolbarPlacement: ToolbarItemPlacement {
#if os(iOS)
return .navigation
#elseif os(watchOS)
return .automatic
#else
return .principal
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,15 @@
import SwiftUI
import ReceiptParser

#if !os(watchOS)

struct ReceiptInspectorView: View {

@State private var encodedReceipt: String = ""
@State private var parsedReceipt: String = ""
@State private var verifyReceiptResult: String = ""
@State private var sharedSecret: String = ""


var body: some View {
VStack {
Text("Receipt Parser")
Expand Down Expand Up @@ -85,3 +87,5 @@ struct ReceiptInspectorView_Previews: PreviewProvider {
ReceiptInspectorView()
}
}

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct ConfigurationView: View {
}

var body: some View {
if #available(iOS 16.0, macOS 13.0, *) {
if #available(iOS 16.0, macOS 13.0, watchOS 9.0, *) {
self.form.formStyle(.grouped)
} else {
self.form
Expand Down Expand Up @@ -89,7 +89,9 @@ struct ConfigurationView: View {
} label: {
Text("Continue")
}
#if !os(watchOS)
.keyboardShortcut(.return)
#endif
.disabled(!self.contentIsValid)
}
}
Expand Down Expand Up @@ -127,7 +129,7 @@ struct ConfigurationView: View {
}

private var buttonPlacement: ToolbarItemPlacement {
#if os(macOS)
#if os(macOS) || os(watchOS)
return .automatic
#else
return .navigationBarTrailing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ struct HomeView: View {
}
#endif

#if !os(watchOS)
Button {
Task<Void, Never> {
do {
Expand All @@ -118,6 +119,7 @@ struct HomeView: View {
} label: {
Text("Manage Subscriptions")
}
#endif

#if os(iOS)
Button {
Expand Down Expand Up @@ -169,7 +171,7 @@ struct HomeView: View {
}

var body: some View {
#if DEBUG && !os(xrOS)
#if DEBUG && !os(xrOS) && !os(watchOS)
if #available(iOS 16.0, macOS 13.0, *) {
self.content
.debugRevenueCatOverlay(isPresented: self.$debugOverlayVisible)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct LocalReceiptView: View {

var body: some View {
VStack {
if #available(iOS 16.0, macCatalyst 16.0, macOS 13.0, *) {
if #available(iOS 16.0, macCatalyst 16.0, macOS 13.0, watchOS 9.0, *) {
self.form
.scrollContentBackground(.hidden)
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ struct LoggerView: View {
self.item(entry)
}
.navigationTitle("Logs")
#if !os(watchOS)
.listRowSeparator(.hidden)
#endif
.transition(.slide)
.animation(.easeInOut(duration: 1), value: self.logger.messages)
.toolbar {
Expand Down

0 comments on commit d1949e0

Please sign in to comment.