Skip to content
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

Add SPM support #266

Merged
merged 1 commit into from
Apr 26, 2021
Merged

Add SPM support #266

merged 1 commit into from
Apr 26, 2021

Conversation

stjernegard
Copy link

This adds support for Swift Package Manager as a way to install the SDK in other projects.

  • UIKit had to be imported in a lot of files that depend on things like UIApplication or UIColor.
  • I've moved all resources into a /Resources/ folder because that made it easier to get all of them in Package.swift.
  • The bundle that contains resources is different in SPM, so that's worth noting. See #if SWIFT_PACKAGE
  • There's a few tests that aren't (always) passing in the SPM tests.
    • EventPublisherTests#testAddSubscriber is simply fragile because it has internal races. It seems to be equally fragile when running from the Xcode project.
    • Multiple tests in LocationServiceTests depend on the host app and test runner sharing a Keychain. That's not the case when running tests via SPM, but not an issue in real projects.
  • CFBundleShortVersionString from Info.plist does not exist when running from SPM, so a new way to store the SDK version in code might be needed to keep the version tracking.

@ssathy2
Copy link
Contributor

ssathy2 commented Mar 10, 2021

Thanks for the PR! I'll test it out and add feedback!

Copy link
Contributor

@ssathy2 ssathy2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@ssathy2 ssathy2 merged commit 77e484c into IFTTT:master Apr 26, 2021
@stjernegard stjernegard deleted the spm branch April 27, 2021 06:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants