-
-
Notifications
You must be signed in to change notification settings - Fork 474
iOS: Enable CocoaPods by providing a podspec #637
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
Conversation
Hi @benjohnde ! Thanks for this addition! I tested by adding it in a fresh iOS project it works fine. Having a published version on cocoapods will help a lot. |
That's actually good news :) Then I have to find out if there exists a better way to lint the spec (lint does actually more than just linting, it validates the spec by compiling the Pod, creating a demo project and integrating the pod). I couldn't find a meaningful way to lint the spec (for some pre-release check) against my local host without replacing the |
Done, CI should turn green in the end 🤞 ! @axxel it is still some decision whether you want to release the CocoaPod integration officially. If so, after an official release one would need to adjust the I am not super familiar with github-actions but there should be a way to automate that after a new version was tagged / published - somehow we should think about that for published android versions as well. Nonetheless, this Pod is working and releasable. |
Thanks for the continued effort. I will merge this but have a couple of open questions:
As the last part of the naming question is affecting all iOS users, let me ping the rest of the bunch again: @alexmanzer @parallaxe @ryantrem |
@axxel I'm right there with you. 👍🏻 I have created a separate PR, which is independent of this CocoaPods topic here: |
Absolutely d'accord with renaming it to ZXingCpp!!! |
Yes, sadly! Not sure if there exists another way of dealing with that honestly!
No, or I did misunderstand the question.
|
I just merged the renaming, so the podspec needs a final update and we are good to go, right? |
@axxel rename is pushed |
I see this was already merged, but I'll add some thoughts regardless. One question for me is whether it is more ideal to have a single podspec, or one per "layer." For example, it's really important at a CMakeLists.txt level to have core separate from specific language bindings ("wrappers"). This makes it easy to use the core library in C++ code that is compiled for different platforms (e.g. Android, iOS, etc.) but doesn't use platform specific languages (e.g. Java, Objective-C, etc.). I wonder a little bit if we'd want the same thing here, where there is a podspec for language bindings that depends on a podspec for core. If a consumer can depend on a single podspec that has both core and language bindings, but can safely ignore the language bindings, then maybe the podspec situation is fundamentally different from the CMakeLists.txt situation, and a single podspec is ok. |
Love these thoughts, I initially created two subspecs, Core & Wrapper. Then I skipped that approach as I weren't sure if one would want the Core without the Obj-C wrapper code. I can provide a recommendation @ryantrem if that's of interest for the react-native realm! |
Preparing the 2.3.0 release, I came by the cocoapods.org page again and was surprised that searching for neither |
General
I did not use the provided modulemap as Swift PM works differently than CocoaPods. To reuse that, I had to change the definition
module ZXingCppWrapper
toframework module ZXingCppWrapper
which then caused a lot of changes and in the end broke the swift package. I decided to go with the pods-generated modulemap (which is enabled by default) and provided the public headers in the spec.This solves #623.
Feedback is very welcome @AbijahKaj @alexmanzer @parallaxe @axxel!
Release
For a potential release I would introduce a proper github-action in this PR (probably something like https://github.com/marketplace/actions/cocoapods-action).
As far as I am aware, the release has to happen before the spec can be validated as normally the spec accesses the version via tag, maybe there is a different variant possible.
Testing
To test that via:
Warnings should be ignored, they have nothing to do with the actual podspec.
One need to replace the source with a local repo, e.g.: