-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Swift Package Manager support #1465
Conversation
- updated .gitignore for SPM - updated Package.swift and set 5.3 as minimum required version. - tweaked IGListCompatibility header imports with TARGET_OS_MACCATALYST so we can build for mac Catalyst.
- support for macCatalyst - changed internal imports to use double quotes instead of angel brackets.
- tweaked imports to workaround swiftPM limitations. - IGListKit already module builds with IGListDiffKit sources and not use it as a separate module dependency. It allows us to avoid "#include<> " mess and keep project structure so cocoapods/carthage/xcode tests should just works. - added USE_SWIFT_PACKAGE_FROM_XCODE to proper support case where swift package was imported as the dependency to Xcode project (using build in support).
Not sure how to trigger CI? |
So strange. If you checkout on commit I made some more experiments and moved all public headers to the |
# Conflicts: # IGListKit.xcodeproj/project.pbxproj # Package.swift # Source/IGListKit/IGListKit.h
Hey hey, thanks for working on this! I also tried out a bit but couldn't figure out how to go around the file structure thing. Looks like your latest approach is to change the files structure to go around the search path thing from Xcode setting, do they work in your latest version? I think it would be a bummer to change all the <IGListKit/XXX.h> to be "XXX.h" format within the library here. But let's see how it goes. |
Hey @lorixx! Yes, I've "inverted" the current master's files structure by putting all public headers to the
So far I was able to verify:
I have some issues with running unit tests from Xcode locally, but it's the same issue in the current |
We moved most of our dependencies to SPM because Cocoapods doesn't play very well with Xcode 12. |
I have some other work right now, but my plan is to alloc some time during the upcoming weekend. :) |
Tests (github workflow) passed on my fork: |
@lorixx friendly ping ... |
Thanks again for working on this! Does this work for the other integrations? Cocoapods and Carthage. |
Hey @lorixx . Yeah, Carthage and cocoa pods passed. The latest test results can be found here https://github.com/3a4oT/IGListKit/actions/runs/372069244 . I have opened separate PR for CI support if you want to go it first for better visibility. |
yeah I think it's better to decouple the SPM support and the new Github CI support, since they are doing different things and related to each other. |
#1478 CI |
@3a4oT Just tested out your spmBrain branch in my project and everything is looking great! I'll have our QA poke around and see if they find any issues but so far so good. Nice work :) |
Just an update, no issues found! Seems production ready to me! |
@lorixx is there a timeline available for getting this merged? We've actually pushed this to our production environment without issue, glad to finally be free of cocoapods! |
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.
@lorixx has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
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.
I just found out that all the files are deleted and re-added, this lost all the previous git history or blame, could you use the "git mv" or similar to mark the file as a move instead of "delete+add"? The goal is to keep the git history and blame for each file so that we know who was the original author. Thanks!
@@ -0,0 +1,224 @@ | |||
name: "IGListKit CI" |
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.
Remove this since you created a separate PR here.
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.
I just found out that all the files are deleted and re-added, this lost all the previous git history or blame, could you use the "git mv" or similar to mark the file as a move instead of "delete+add"? The goal is to keep the git history and blame for each file so that we know who was the original author. Thanks!
Sorry for the mess, it was a hard time put those together and I moved files around with different combinations. I think I found a better solution for it, please see #1487. I tried to keep changes as small as possible.
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.
@RamblinWreck77 thanks for the feedback! |
Any progress on official support? |
any update on this? |
You know what I'm going to ask :) |
Summary: ## Changes in this pull request A better version of Instagram#1465 =) - SPM support with script-based generations. - added macOS Catalyst support ### Generate SPM layout 1. From **project's root** run: `bash scripts/generate_spm_sources_layout.sh` 2. Commit Changes Repeat those steps each time you delete/add the project's files. **Make sure** to have this CI step which will check that `generate_spm_sources_layout.sh` is not broken. Issue fixed: Instagram#1368 Instagram#1406 ### Checklist - [ ] All tests pass. Demo project builds and runs. - [ ] I added tests, an experiment, or detailed why my change isn't tested. - [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md) Pull Request resolved: Instagram#1487 Reviewed By: candance Differential Revision: D25562739 Pulled By: lorixx fbshipit-source-id: eb4f9e82e6b4842aae71585e0c1377c13cf21196
Summary: ## Changes in this pull request A better version of Instagram#1465 =) - SPM support with script-based generations. - added macOS Catalyst support ### Generate SPM layout 1. From **project's root** run: `bash scripts/generate_spm_sources_layout.sh` 2. Commit Changes Repeat those steps each time you delete/add the project's files. **Make sure** to have this CI step which will check that `generate_spm_sources_layout.sh` is not broken. Issue fixed: Instagram#1368 Instagram#1406 ### Checklist - [ ] All tests pass. Demo project builds and runs. - [ ] I added tests, an experiment, or detailed why my change isn't tested. - [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md) Pull Request resolved: Instagram#1487 Differential Revision: D30428297 Pulled By: lorixx fbshipit-source-id: 7fe5e99f2c6faf695a74588743a17fcafd02de44
Summary: ## Changes in this pull request A better version of #1465 =) - SPM support with script-based generations. - added macOS Catalyst support ### Generate SPM layout 1. From **project's root** run: `bash scripts/generate_spm_sources_layout.sh` 2. Commit Changes Repeat those steps each time you delete/add the project's files. **Make sure** to have this CI step which will check that `generate_spm_sources_layout.sh` is not broken. Issue fixed: #1368 #1406 ### Checklist - [ ] All tests pass. Demo project builds and runs. - [ ] I added tests, an experiment, or detailed why my change isn't tested. - [ ] I added an entry to the `CHANGELOG.md` for any breaking changes, enhancements, or bug fixes. - [ ] I have reviewed the [contributing guide](https://github.com/Instagram/IGListKit/blob/master/.github/CONTRIBUTING.md) Pull Request resolved: #1487 Reviewed By: DimaVartanian, candance Differential Revision: D30428297 Pulled By: lorixx fbshipit-source-id: 655291ff03445dec9b0b8cd97916f0c88207e9a7
Hey folks! Sorry to revive this old thread. I'm going through the list of PRs now and seeing which ones we can close out in preparation of a new version launch. It seems to me that this PR was further refined down the line and this was used to create the SPM setup we have today. I can definitely confirm that SPM support works great now (We're using it for the sample projects now!) so I think we can close this PR out having done its job. Thanks again for all your contributions! |
Changes in this pull request
Added proper support for Swift Package Manager (SPM).
"inverted" the current master's files structure by putting all public headers to the
include
folder and all internal/private moved to the package's root. Swift Package Manager documentationcreated symbolical links for IGListKit with the relative path to IGListDiffKit's private headers to work around an issue for private headers search path. Seems like it works pretty well for SPM, cocoapods and original Xcode workspace.
added macOS Catalyst support
Supported targets:
TODO:
Issue fixed: #1368 #1406
Checklist
CHANGELOG.md
for any breaking changes, enhancements, or bug fixes.