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

Add Podspecs for the Cordova library project #542

Closed
bhariharan opened this issue Feb 21, 2019 · 9 comments · Fixed by #543
Closed

Add Podspecs for the Cordova library project #542

bhariharan opened this issue Feb 21, 2019 · 9 comments · Fixed by #543
Milestone

Comments

@bhariharan
Copy link
Contributor

Feature Request

Add a podspec file for the Cordova project.

Motivation Behind Feature

  • This allows projects to fetch Cordova through Cocoapods if they choose to use that instead of the cordova CLI.
  • Upgrades are seamless and as simple as changing the version in the app's podspec file.
  • Very easy to maintain. No overhead on the Cordova project either.

Feature Description

  • Consuming via Cocoapods would be a breeze.
  • Adding pod 'Cordova' as one of the dependencies with the URL specified would fetch the Cordova library in the app and generate the workspace.
  • I have tested this in my own environment and it works great.

Alternatives or Workarounds

  • Unfortunately, there are no workarounds if you want to use Cocoapods and Cordova.
@janpio
Copy link
Member

janpio commented Feb 21, 2019

Would this be a reincarnation of https://cocoapods.org/pods/Cordova?

@bhariharan
Copy link
Contributor Author

@janpio Sort of. It doesn't incur the overhead of having to publish to cocoapods.org, but it allows libraries to consume Cordova through Cocoapods from this GitHub repo. Technically, you could publish these specs to cocoapods.org too. I'm not sure why Cordova stopped publishing pod specs.

@janpio
Copy link
Member

janpio commented Feb 21, 2019

I'm not sure why Cordova stopped publishing pod specs.

As only 2 of the 7 names in the "maintained by" list ring a bell for me at all, this might probably have been the reason - it just happened.

I don't know to much about iOS and nothing about Cocoapods, what whould a command to use this look like when this is merged?

Will this "publish" specific releases or just master of this repo?

@bhariharan
Copy link
Contributor Author

This will specify pod specs for releases.

  • The release version is specified here. All you have to do is bump up this version to the version you're releasing as part of your release process.

  • This tag specifies which tag of the repo to fetch these pod specs from. It automatically pulls it in from the aforementioned version number. I am using Cordova's existing tagging convention, so it should just work out of the box.

  • I have added some detailed notes here, it's pretty straightforward.

  • Here is an example of how a library would consume these pod specs.

@janpio
Copy link
Member

janpio commented Feb 21, 2019

Thanks for the newbie friendly explainer here.

@bhariharan
Copy link
Contributor Author

@janpio Glad to help. Could you help review this PR and get it merged? It would unblock one of my projects.

@janpio
Copy link
Member

janpio commented Feb 21, 2019

Ha, definitely not - I should really understand what I merge. But @dpogue is on it, see his comments.

One last question: How does a project including Cordova this way use Cordova?

@bhariharan
Copy link
Contributor Author

@janpio It would reference it like this. Our project builds on top of Cordova, it's a complicated set of plugins that leverage a lot of native functionality.

dpogue pushed a commit that referenced this issue Feb 27, 2019
@dpogue dpogue added this to the 5.0.1 milestone Mar 15, 2019
@dpogue dpogue modified the milestones: 5.0.1, 5.0.2 Apr 17, 2019
@brodycj brodycj modified the milestones: 5.0.2, 6.0.0 Dec 26, 2019
@brodycj
Copy link
Contributor

brodycj commented Dec 27, 2019

As a Podspec newbie, I do have a concern that the upgradable Podspec assumes that the interface between JavaScript and the native side will remain stable.

Normally, upgrading cordova-ios would upgrade both the JavaScript bundled in cordova.js and the native side. My concern is that the flexible Podspec would introduce a risk of newer native code that is not compatible with the existing JavaScript code in cordova.js.

While I do not expect this interface to change very much in the near future, I think we should be very careful about this kind of risk and hope we can find a good way to mitigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants