-
Notifications
You must be signed in to change notification settings - Fork 117
Simplify Experiments into a Swift package #15622
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
Conversation
Generated by 🚫 Danger |
9423902
to
acd51eb
Compare
|
acd51eb
to
eae2e4c
Compare
eae2e4c
to
9cbaeb7
Compare
When moving from frameworks to Swift packages, see for example #15622 and #15651, we lose the framework headers which had statements like `#import <Foundation/Foundation.h>`. This means that basic frameworks such as Foundation and UIKit are no longer imported as part of consumers frameworks such as Yosemite. To simplify the code review of the upcoming PRs migrating those frameworks to Swift packages in `Modules/`, this PR preemptively adds the required imports in the files that need them. This was done by running `git reset trunk` on the workbench branch `temp-branch-for-swiftpm-migration` and only committing the `import` additions in this branch.
When moving from frameworks to Swift packages, see for example #15622 and #15651, we lose the framework headers which had statements like `#import <Foundation/Foundation.h>`. This means that basic frameworks such as Foundation and UIKit are no longer imported as part of consumers frameworks such as Yosemite. To simplify the code review of the upcoming PRs migrating those frameworks to Swift packages in `Modules/`, this PR preemptively adds the required imports in the files that need them. This was done by running `git reset trunk` on the workbench branch `temp-branch-for-swiftpm-migration` and only committing the `import` additions in this branch.
9cbaeb7
to
1d33e99
Compare
@@ -1,6 +1,7 @@ | |||
import Foundation | |||
import KeychainAccess | |||
import Networking | |||
import UserNotifications |
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.
Explanation for why this and the Foundation import below are here can be found in #15698
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.
👋 These changes LGTM @mokagio - I was able to build and test locally and see that CI passed. Approving to unblock but other reviews are welcome.
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.
Actually on second thought @mokagio - when trying to run WCiOS in a Simulator I'm seeing:
dyld[36556]: Symbol not found: _$sSo7UIColorC13WooFoundationE15withColorStudio_5shadeAB0bC4Core0eF0V_AF0eF5ShadeOtFZ
Referenced from: <A6BCB995-881E-31AF-92A5-6146F3FFD8EC> /Users/tanner/Library/Developer/CoreSimulator/Devices/7586F18C-8D66-495B-BFB8-6346FCF526B1/data/Containers/Bundle/Application/EF3681BC-7340-4715-B3A4-A2E30D1DF40C/WooCommerce.app/WooCommerce.debug.dylib
Expected in: <5F3EA820-850E-3F18-91A5-97361DE9CEDD> /Users/tanner/Library/Developer/Xcode/DerivedData/WooCommerce-dutzhurnuvsqusgjnyibtbncmmou/Build/Products/Debug-iphonesimulator/WooFoundation.framework/WooFoundation
I'll double-check that this isn't something in my local environment.
Edit: After cleaning my local environment and rebuilding I'm able to run the app without this crash.
Thanks @twstokes ! Regarding the issue that resolved itself after cleaning, I'm afraid we can expect a few of those as we transition. A positive side effect of having to bulk move all the remaining frameworks because of how Fakes is used in the tests and links to all of them, #15678, is that we don't have many PRs left till the migration is done. |
Description
Similar too #15651 , this PR converts the Experiments framework into a Swift package in
Modules/
.See also https://linear.app/a8c/issue/AINFRA-471
Unfortunately, this is the last individual framework migration we can perform. The rest will need to be moved in bulk because the tests all depend on
Fakes
, which in turn depends on the rest of the frameworks.Steps to reproduce & Testing information
See green CI + run this branch on device.
Screenshots
RELEASE-NOTES.txt
if necessary.Reviewer (or Author, in the case of optional code reviews):
Please make sure these conditions are met before approving the PR, or request changes if the PR needs improvement: