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

[Swift] Support CocoaPods alongside Swift Package Manager #5766

Closed
bbqsrc opened this issue Feb 12, 2020 · 14 comments · Fixed by #5771
Closed

[Swift] Support CocoaPods alongside Swift Package Manager #5766

bbqsrc opened this issue Feb 12, 2020 · 14 comments · Fixed by #5771

Comments

@bbqsrc
Copy link

bbqsrc commented Feb 12, 2020

We have a package that uses CocoaPods for package management, and migrating to SwiftPM is not an option for us due to the project being a polyglot project.

Would it be acceptable to support CocoaPods alongside SwiftPM? Should be possible to keep everything as it is with just the addition of a Podspec file.

@mustiikhalil
Copy link
Collaborator

@bbqsrc that would be amazing! How hard is it going to be? and would it require a specific user to maintain it? or can anyone update the version?

if you are up to it, a PR would be nice

@bbqsrc
Copy link
Author

bbqsrc commented Feb 12, 2020

How hard is it going to be?

Not too hard. Would require hooks to the CI process to publish to the Specs repo, that's about it. Then people can do pod 'FlatBuffers' and it should Just Work™.

More info: https://guides.cocoapods.org/making/making-a-cocoapod.html

would it require a specific user to maintain it? or can anyone update the version?

Should only require bumping the relevant metadata on releases and updates to Swift minimum language or minimum platform.

if you are up to it, a PR would be nice

Will see what I can do this week.

@mustiikhalil
Copy link
Collaborator

mustiikhalil commented Feb 12, 2020

@aardappel this would be a very cool addition to swift!

@bbqsrc nice!

@mustiikhalil
Copy link
Collaborator

trunk I guess we have two options here

  • Requires one of the actual main contributors to Publish it and then add people building for swift as maintainers
  • @bbqsrc just publishes it and then add main contributors as maintainers?.
    @aardappel what do you think?

@aardappel
Copy link
Collaborator

In https://github.com/google/flatbuffers/wiki/FlatBuffers-release-process we already have a bunch of publishing actions for other languages, so we could add one for Swift.. what is not great me for me (if I am the one to be doing this publishing, is needing additional accounts, keys, tools etc to do so, especially if this needs to be on a mac).

The alternative is that @mustiikhalil takes care of this publishing, much like @rw already publishes Rust, etc.

The other thing is wether this packaging method requires yet another file in the root of the repo :)

@bbqsrc
Copy link
Author

bbqsrc commented Feb 12, 2020 via email

@mustiikhalil
Copy link
Collaborator

@bbqsrc if that's the case do you want me to work on it? Since as @aardappel suggested I will have to publish it either ways

@bbqsrc
Copy link
Author

bbqsrc commented Feb 13, 2020

@mustiikhalil that would be great. I can offer advice if you run into any troubles.

@mustiikhalil
Copy link
Collaborator

@bbqsrc sound good! I will start working on it, and if I need help I will be tagging you

@mustiikhalil
Copy link
Collaborator

mustiikhalil commented Feb 15, 2020

I have been working on it, however I found out that we need the podspec file to be in the root of the library. should we give swift it's own branch @aardappel which would allow us to use SPM and cocoapods without making it be in the root as @mzaks suggested while doing the swift PR? or should I simply add it into the root folder for now?

#5708 as you can see here, it was already requested.

I can also simply maintain it in here:
https://github.com/mustiikhalil/flatbuffers/tree/swift So whenever people would want to install it for SPM and Cocoapods, they can just use it directly from there. (ofc I will have to first merge to the main repository then fetch and merge to that one)

@mustiikhalil
Copy link
Collaborator

@rw can you enlighten us on how did you make the rust cargo work although it's not in the root of the repository?

@rw
Copy link
Collaborator

rw commented Feb 17, 2020

@mustiikhalil Rust Cargo doesn't need packages to have any relation to git files. A common design pattern in Rust is to have multiple subcrates that live in the same repository. That's unfortunate that Swift seems so strict on this point.

@mustiikhalil
Copy link
Collaborator

@bbqsrc I've added FlatBuffers to CocoaPods, you can follow the readme in the swift branch

@bbqsrc
Copy link
Author

bbqsrc commented Feb 21, 2020

Thanks so much, will let you know when I test it.

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 a pull request may close this issue.

4 participants