-
Notifications
You must be signed in to change notification settings - Fork 319
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
export RevenueCatUI xcframework #4172
Conversation
@RCGitBot please test |
bbd776e
to
e811671
Compare
Fixes the tests that were failing in `main`, which you can see in #4172
@aboedo Thank you for this? Is there a chance to grab a binary from this PR already? It's quite a show stopper for us this week. Many thanks! |
dd98303
to
b37920e
Compare
@hansemannn apologies, the approach I tested sadly didn't quite work, but I'm actively trying to figure out why the output format isn't quite correct |
13c90ab
to
6eaeb9e
Compare
SKIP_INSTALL = YES; | ||
SKIP_INSTALL = NO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not strictly needed to have these set correctly since the fastlane lane does set them, but it's also a good idea to have them so that if we want to archive manually it works correctly.
SKIP_INSTALL
should be NO
for frameworks, and BUILD_LIBRARY_FOR_DISTRIBUTION
should be YES
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// wrapping with AnyView to type erase is needed because when archiving an xcframework, | ||
// the compiler gets confused between the types returned | ||
// by the different implementations of self.onChange(of:value). | ||
if #available(iOS 17.0, macOS 14.0, tvOS 17.0, watchOS 10.0, *) { | ||
self.onChange(of: value) { _, newValue in action(newValue) } | ||
AnyView(self.onChange(of: value) { _, newValue in action(newValue) }) | ||
} else { | ||
self.onChange(of: value) { newValue in action(newValue) } | ||
AnyView(self.onChange(of: value) { newValue in action(newValue) }) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this one drove me nuts and did not have a nice error message, fun times
RevenueCatUI/Views/IconView.swift
Outdated
case add | ||
case plus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
talk about driving me NUTS. having it named add
creates a collision with a UIKit name, but the collision happens when Swift auto-generates intermediate files, and has a terrible error message.
fastlane/Fastfile
Outdated
lane :export_xcframework do |options| | ||
lane :export_xcframeworks do |options| | ||
create_and_sign_xcframework(scheme: 'RevenueCat', product_name: 'RevenueCat') | ||
create_and_sign_xcframework(scheme: 'RevenueCatUIDev', product_name: 'RevenueCatUI') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
only note here: I had to use the RevenueCatUIDev
scheme, not RevenueCatUI
because that one doesn't archive correctly for some reason. That one is tied to SPM. I intend to remove that scheme altogether and rename RevenueCatUIDev
-> RevenueCatUI
to prevent confusion, but one thing at a time
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also the product name determines the actual xcframework name that gets sent out
fastlane/Fastfile
Outdated
create_and_sign_xcframework(scheme: 'RevenueCatUIDev', product_name: 'RevenueCatUI') | ||
end | ||
|
||
private_lane :create_and_sign_xcframework do |options| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this part is just extracting common logic
6eaeb9e
to
3f4c171
Compare
tested using the xcframework that this generates and it works correctly |
@hansemannn I'm re-running manually and will upload the xcframeworks that I get here so you can use them, but it should also be available on all releases once this PR is merged |
welp, the whole archive is pretty huge (130mb) so I can't just upload as a comment, but I'll get this merged and add it to the latest release |
Thanks a lot! Dropbox / iCloud Drive / Google Drive would also fine, but I am trying to wait 😅 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approved to unblock you, but would be good for someone with more context to have a final look!
@hansemannn we'll get it into the next release which should come out today or tomorrow, but here are the download links in the meantime: |
RevenueCatUI/Views/IconView.swift
Outdated
@@ -35,7 +35,7 @@ struct IconView<S: ShapeStyle>: View { | |||
/// An icon to be displayed by `IconView`. | |||
enum PaywallIcon: String, CaseIterable { | |||
|
|||
case add | |||
case plus |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pretty sure we need to make this have the value of "add" so it codables correctly with the value we use in the JSON response for paywalls 🤔 plus
isn't a known icon name
case plus | |
case plus = "add" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ooff right I thought it was just referencing a local file, didn't realize it needed to match a backend name. That's a bit of a problem, given the UIKit naming conflict.
Maybe we can solve it by decoupling the local property name from the key from the backend in the codable side, let me see
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lol just saw that you had actually already left a suggestion for the change 🤦 I'll try to repro with a paywall before and after to make sure all things work
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be careful when you make the change that the "+" image still shows up in the live paywall if you select it as the list tick. I ran into this issue during an aborted project reorg attempt.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, the image won't show up, gonna need to do something extra here, will post here again when it's solved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for flagging this!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good solution!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2590cdb
to
7a38b68
Compare
Merged! @hansemannn thanks for bringing this up and for the patience with it! I'll make sure that the next release that goes out includes the xcframework. In the meantime, please know that there is a bug in the build that I uploaded in this branch earlier, as @joshdholtz pointed out. In that build, all things should work normally, other than if you try to use the The build included in the release won't have the issue |
Thanks a lot for the fast solution here - I followed it every day :) We are unblocked already by the build and Paywalls rock! Thanks to the whole team! |
Follow up to #4172 Adds the xcframework as a circleci artifact Also fixes a code signing issue when archiving `RevenueCatUI.xcframework` linear ticket: SDK-3555
The official docs don't say a lot about `SKIP_INSTALL`, but I missed the mark during the #4172 PR, where the ideal setup is NO for debug, YES for release. I spent a lot of time figuring this out a couple of years back but the other day I completely forgot about it 🤦 <img width="1128" alt="image" src="https://github.com/user-attachments/assets/4256ec42-00c2-4de2-a622-9a151b849781"> <img width="747" alt="image" src="https://github.com/user-attachments/assets/c8cdf454-0558-489b-bb24-b3006a4ebacb"> Here's ChatGPT's far better explanation than Apple's: ``` • Debug Configuration: • SKIP_INSTALL = YES • During development, you typically don’t need to install (or include) the product (e.g., .framework, .app) in the final build output. The focus is on quick builds, so setting SKIP_INSTALL = YES can help speed up the process by skipping unnecessary steps. • Release Configuration: • SKIP_INSTALL = NO • In the Release configuration, you usually want to include everything in the final build output. This is particularly important when archiving for distribution or creating .xcframeworks, as you need the final product to be available in the archive. Example Scenario If you are building a framework that is used by other targets in your project: • Debug Configuration: • Set SKIP_INSTALL = YES so that intermediate builds are faster, and the framework isn’t unnecessarily copied to the install location. • Release Configuration: • Set SKIP_INSTALL = NO so that when you archive the framework, it is included in the final archive, making it available for distribution or further use. ```
**This is an automatic release.** ### New Features * Price rounding logic (#4132) via James Borthwick (@jamesrb1) ### Bugfixes * [Customer Center] Migrate to List style (#4190) via Cody Kerns (@codykerns) * [Paywalls] Improve locale consistency (#4158) via Josh Holtz (@joshdholtz) * Set Paywalls Tester deployment target to iOS 15 (#4196) via James Borthwick (@jamesrb1) * [Customer Center] Hide Contact Support button if URL can't be created (#4192) via Cesar de la Vega (@vegaro) * Fix the setting for SKIP_INSTALL in Xcode project (#4195) via Andy Boedo (@aboedo) * [Customer Center] Improving customer center buttons (#4165) via Cody Kerns (@codykerns) * Revert workaround for iOS 18 beta 5 SwiftUI crash (#4173) via Mark Villacampa (@MarkVillacampa) * [Paywalls] Make iOS version calculation lazy (#4163) via Mark Villacampa (@MarkVillacampa) * [Paywalls] Observe `PurchaseHandler` when owned externally (#4097) via James Borthwick (@jamesrb1) ### Other Changes * [Customer Center] Clean up colors in WrongPlatformView and NoSubscriptionsView (#4204) via Cesar de la Vega (@vegaro) * Fix failing `all-tests` and retry more flaky tests (#4188) via Josh Holtz (@joshdholtz) * Compatibility content unavailable improvements (#4197) via James Borthwick (@jamesrb1) * Create lane to enable customer center (#4191) via Cesar de la Vega (@vegaro) * XCFramework artifacts in CircleCI (#4189) via Andy Boedo (@aboedo) * [Customer Center] CustomerCenterViewModel checks whether the app is the latest version (#4169) via JayShortway (@JayShortway) * export RevenueCatUI xcframework (#4172) via Andy Boedo (@aboedo) * Corrects references from ManageSubscriptionsButtonStyle to ButtonsStyle. (#4186) via JayShortway (@JayShortway) * Speed up carthage installation tests (#4184) via Andy Boedo (@aboedo) * Customer center improvements (#4166) via James Borthwick (@jamesrb1) * replace `color(from colorInformation:)` global with extension (#4183) via Andy Boedo (@aboedo) * Fix tests in main (#4174) via Andy Boedo (@aboedo) * Enable customer center tests (#4171) via James Borthwick (@jamesrb1) * [Customer Center] Initial implementation (#3967) via Cesar de la Vega (@vegaro) --------- Co-authored-by: Josh Holtz <[email protected]>
Fixes the tests that were failing in `main`, which you can see in #4172
We don't currently export RevenueCatUI as an xcframework, which can be a source of confusion and a dealbreaker for customers who need a pre-built framework. This adds RevenueCatUI's xcframework into the `export_xcframeworks` lane, and includes the output in the `github_release` lane. Should help address: - #4168 - #4146 - #4056
Follow up to #4172 Adds the xcframework as a circleci artifact Also fixes a code signing issue when archiving `RevenueCatUI.xcframework` linear ticket: SDK-3555
The official docs don't say a lot about `SKIP_INSTALL`, but I missed the mark during the #4172 PR, where the ideal setup is NO for debug, YES for release. I spent a lot of time figuring this out a couple of years back but the other day I completely forgot about it 🤦 <img width="1128" alt="image" src="https://github.com/user-attachments/assets/4256ec42-00c2-4de2-a622-9a151b849781"> <img width="747" alt="image" src="https://github.com/user-attachments/assets/c8cdf454-0558-489b-bb24-b3006a4ebacb"> Here's ChatGPT's far better explanation than Apple's: ``` • Debug Configuration: • SKIP_INSTALL = YES • During development, you typically don’t need to install (or include) the product (e.g., .framework, .app) in the final build output. The focus is on quick builds, so setting SKIP_INSTALL = YES can help speed up the process by skipping unnecessary steps. • Release Configuration: • SKIP_INSTALL = NO • In the Release configuration, you usually want to include everything in the final build output. This is particularly important when archiving for distribution or creating .xcframeworks, as you need the final product to be available in the archive. Example Scenario If you are building a framework that is used by other targets in your project: • Debug Configuration: • Set SKIP_INSTALL = YES so that intermediate builds are faster, and the framework isn’t unnecessarily copied to the install location. • Release Configuration: • Set SKIP_INSTALL = NO so that when you archive the framework, it is included in the final archive, making it available for distribution or further use. ```
**This is an automatic release.** ### New Features * Price rounding logic (#4132) via James Borthwick (@jamesrb1) ### Bugfixes * [Customer Center] Migrate to List style (#4190) via Cody Kerns (@codykerns) * [Paywalls] Improve locale consistency (#4158) via Josh Holtz (@joshdholtz) * Set Paywalls Tester deployment target to iOS 15 (#4196) via James Borthwick (@jamesrb1) * [Customer Center] Hide Contact Support button if URL can't be created (#4192) via Cesar de la Vega (@vegaro) * Fix the setting for SKIP_INSTALL in Xcode project (#4195) via Andy Boedo (@aboedo) * [Customer Center] Improving customer center buttons (#4165) via Cody Kerns (@codykerns) * Revert workaround for iOS 18 beta 5 SwiftUI crash (#4173) via Mark Villacampa (@MarkVillacampa) * [Paywalls] Make iOS version calculation lazy (#4163) via Mark Villacampa (@MarkVillacampa) * [Paywalls] Observe `PurchaseHandler` when owned externally (#4097) via James Borthwick (@jamesrb1) ### Other Changes * [Customer Center] Clean up colors in WrongPlatformView and NoSubscriptionsView (#4204) via Cesar de la Vega (@vegaro) * Fix failing `all-tests` and retry more flaky tests (#4188) via Josh Holtz (@joshdholtz) * Compatibility content unavailable improvements (#4197) via James Borthwick (@jamesrb1) * Create lane to enable customer center (#4191) via Cesar de la Vega (@vegaro) * XCFramework artifacts in CircleCI (#4189) via Andy Boedo (@aboedo) * [Customer Center] CustomerCenterViewModel checks whether the app is the latest version (#4169) via JayShortway (@JayShortway) * export RevenueCatUI xcframework (#4172) via Andy Boedo (@aboedo) * Corrects references from ManageSubscriptionsButtonStyle to ButtonsStyle. (#4186) via JayShortway (@JayShortway) * Speed up carthage installation tests (#4184) via Andy Boedo (@aboedo) * Customer center improvements (#4166) via James Borthwick (@jamesrb1) * replace `color(from colorInformation:)` global with extension (#4183) via Andy Boedo (@aboedo) * Fix tests in main (#4174) via Andy Boedo (@aboedo) * Enable customer center tests (#4171) via James Borthwick (@jamesrb1) * [Customer Center] Initial implementation (#3967) via Cesar de la Vega (@vegaro) --------- Co-authored-by: Josh Holtz <[email protected]>
We don't currently export RevenueCatUI as an xcframework, which can be a source of confusion and a dealbreaker for customers who need a pre-built framework.
This adds RevenueCatUI's xcframework into the
export_xcframeworks
lane, and includes the output in thegithub_release
lane.Should help address: