-
Notifications
You must be signed in to change notification settings - Fork 3
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
CocoaPods support #52
Comments
CocoaPods is still around? Somebody, please put it out of its misery. Anyhow, I can look into it. Or, if you're willing to do the work—that'd be cool. Cheers, Oscar. |
Yeah. Understand you. But they are half-dead, not fully dead yet. Because SPM doesn't have all the features (plugins are good, but have problems). |
Added in PR: #56 |
About StaticBigInt feature. For CocoaPods, theoretically, it can be added as a Subspec. So dependency can be added as If it will work - CocoaPods release can support both at the same time |
For Package.swift maybe it can be done through SPM plugin |
That's neat, but I want to minimize complexity and not special-case StaticBigInt too much. |
The workflow should now work independently of new releases.
Zzz. https://github.com/oscbyspro/Numberick/actions/runs/5918950282
|
Because you can't lint them this way. For proper linting I created local CocoaPods repo, pushed dependencies in it and linted last one library. You can find it in the original script
|
Is there a reason why this does not work? Asking for a CocoaPods n00b. Edit: I changed the sources and gave it a special tag. It downloads the spec, but complains it can't find it: spec.source = { :git => "https://github.com/oscbyspro/Numberick.git", :tag => "CocoaPods-v0.10.0-alpha" } |
CocoaPods expect all libraries' specs to be pushed to the centralized repo. They are not decentralized (same as npm, pip, gems, etc.) So when it tries to lint library it searches for its dependencies on the repos, and can't find them. |
Hm. I see this in my pod repo with
Does that not count? Do I need each podspec too? |
I suppose it got there with this, but the lint still failed:
|
And it will fail. It needs a repo with a special structure managed internally by CocoaPods. It's not your repo. |
When it lints the second library it expects that the first one is already pushed to the centralized repo. While linting the second one it will download sources for the first one to the temp directory for lint and build it from these sources. In my script, I zipped sources and changed the URL to this file (to avoid redownloads), and then pushed dependencies to the local CocoaPods git repo (made from a temp folder). This way it works best (because it will emulate the proper installation of the dependencies). You can try the second option - the |
But I think in your case the second option could work. Your library build is not a complex one with binary dependencies. Try this command: |
Hm. It's says |
My bad. It should be with
for the third one maybe will work something like |
Yer a wizard, Yehor. The following works, using
|
You have to lint all of them one by one. Start from the core one and add one dependency at a time. You can share the env variable through the |
And update the version by regex from a tag name. It really works better. Because you can forget to update podspecs before creating a tag and it will break everything. It's better to do less work. That is simply from practice |
I see you're saying, but not why it's needed. In my mind, "lib lint Numberick.podspec" covers all of them, no? It runs every test in the package, and it can only do so if "Numberick-NBKCoreKit.podspec" and "Numberick-NBKDoubleWidthKit.podspec" are valid specifications, no? |
Re: regex. There's a problem of "If you change the thing you're testing, how do you know the unchanged version is valid?" correctness-headache that I'd like to avoid if at all possible. |
No. It will run only tests from Numberick.podspec and will ignore other package tests. You can specify all tests inside Numberick.podspec only, but it breaks the idea of modules. So if you want to run tests from Numberick-NBKCoreKit.podspec you have to lint it too. Specify package tests in package podspecs and lint them all one by one |
In the case of CocoaPods, it's ok because before publishing it will test the exact version you are publishing. So it will be tested after the version update and published only if everything works fine. And for the test workflow, you don't need to change anything. Use version |
I prefer to do something like this: main...ypopovych:Numberick:pods-lint so it will not break the module structure of the library (tests will run for proper modules, not from Numberick) |
Sounds reasonable to me. I'm contemplating what to do with tags and such. I kinda want to validate things before I tag them. I'm unsure whether there's a great way to automate pre-tag validation beyond a script with manual dispatch, however. |
I thought of 2 solutions for my repositories:
|
I thought CocoaPods publishing was set to manual dispatch and got excited about pressing the button on v0.11.0. But, apparently, it triggers on release and v0.10.0 was published. So, does it work? I haven't tried it. |
Hello!
Thanks for an incredible library!
I want to use it in the https://github.com/tesseract-one/ScaleCodec.swift library as a dependency for BigInt/UInt types. But we need CocoaPods support.
I understand that CocoaPods is an old tech, but it works and some techs like ReactNative or KotlinNative depend on it.
Can I create PR with Podfile and the needed fixes for proper CocoaPods publishing? I will also add GitHub action for automatic publishing on the release.
Thanks, Yehor.
The text was updated successfully, but these errors were encountered: