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 support for SwiftPM #291

Closed
wants to merge 2 commits into from

Conversation

maniramezan
Copy link

@maniramezan maniramezan commented Feb 10, 2020

This PR is adding support for SwiftPM. At the moment, the tests compile, but crashes when you run due to DateTools.bundle not being in the final bundle. Adding resources file to swiftpm has been recently added in SE-0271, but at the time of submitting this PR, it's not included in any available Swift snapshots or Xcode11.4b1 version. When it lands in public, the tests can be fixed also in addition to adding DateTools.bundle as a resource. This is similar to #285 PR.

Just note that for using SwiftPM at the moment, developers need to add DateTools.bundle manually to their codebase. Might worth to also update Readme file to mention SwiftPM integration and the necessity of adding the bundle file.

@MatthewYork
Copy link
Owner

I will get this reviewed and merged first thing tomorrow! Just want to run through some of the tests since it looks like they have changed.

Also, I’m not up to date on SPM... do I need to advertise/list it anywhere? Thanks!

@maniramezan
Copy link
Author

maniramezan commented Feb 10, 2020

IMO it should be mentioned in Readme file as part of installation and emphasize on including bundle manually until adding resource capability is available in SwiftPM. Especially because it causes a crash if you don’t and use any of the APIs using the localization.

@MatthewYork
Copy link
Owner

Haven't forgotten about you! Had a few things come up at work, so might be closer to the weekend.

@maniramezan
Copy link
Author

No hurries, whenever you get to it, let me know if you had any questions. I’m still waiting for new Xcode11.4 beta to comes out to see if it’ll include resource changes.

@tgymnich
Copy link

tgymnich commented Jul 4, 2020

any updates on this?

@maniramezan
Copy link
Author

You can use master branch from my fork if you need this. Just be sure to manually add the bundle. I'm going to open another PR which uses 5.3 tolls which can handle resources so this won't be necessary.

@maniramezan
Copy link
Author

For future reference, https://github.com/maniramezan/DateTools/tree/mani_swiftpm_5_3 contains the work for using SwiftPM 5.3 tooling which supports resources. For now, that branch breaks cocoapods and Carthage integrations due to lack of support for Bundle.module in those versions. Will wait on a few more betas to see if there'd be a fix or a recommended way to solve this issue.

@maniramezan
Copy link
Author

Closing this in favor of #294

@maniramezan maniramezan deleted the mani_swiftpm branch October 19, 2020 23:10
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.

None yet

3 participants