Closed Jeehut closed 4 years ago
This becomes much more important in XCode 11 as Apple has added direct support for SPM in all xcode projects. This will soon become the preferred way to manage dependencies. Getting this in will be very helpful.
Does Package.swift
apply to XCode 11 as is, or would it require any changes? Anybody tried this?
For what it's worth I tested this, and there seems to be a conflict between the module name and class being MBProgressHUD
.
This is what happens when I try to extend it.
And issues at a call-site.
It quite likely could be. I'm wondering what a good fix would be that adds SPM support. All changes seem like they would be breaking, but I assume the easiest would be to change the module name rather than all of the classes?
I agree, changing the module name within the Package.swift
file would probably be the least affecting method of getting it working with SwiftPM. We would probably need to specify the path for the target explicitly and document that the import
statement for SwiftPM users would be different, maybe just MBProgress
?
That sounds like a good suggestion to me, and after a few days I can't really think of a better way to resolve the conflict.
Can you perform these changes on your fork? Would be happy to see this merged or use your fork.
Hey, for those interested, I just created https://github.com/jdg/MBProgressHUD/pull/592 that doesn't have the conflict between the module name and class being MBProgressHUD
.
If @Jeehut wants to incorporate the changes in this PR or just merge the other PR, I'm fine with both options 🙂
Thank you @4brunu, I just rebased my fork, cherry-picked your changes in a single commit and added a badge that MBProgressHUD supports SwiftPM to the README. I think you can close #592 now ad a duplicate to this. Great work with the modulemap etc.!
@Jeehut no problem 🙂 Done, I closed the PR. What do you think about adding the SPM instructions to the readme? I saw the Accio instructions but not the SPM. I know they are almost the same, but it's just to clarify to the users when they look for SPM in the readme.
@4brunu Makes sense. It's just the same steps, only the command is different, fixed it! 👍
Thanks 👍 I have tested this PR locally and it's working, for me it's ready to merge 🙂
Alright, let's give this a try. I don't use Swift package manager, so I'll just rely on your expertise here. Thank you for your contribution!
Nice, thanks 👍 Could you please also make a new release? Because it would be nicer to point SPM to a tag instead of a branch or a commit 🙂
This adds support for SwiftPM manifest based dependency managers. Specifically this adds support for installing via Accio but may also work with SwiftPM once it's integrated into Xcode.
Please note that this project is part of Accio's official integration tests within the Demo project.