Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cocoapods questions: "How does cocoapods know when a new version of a library is available?" etc

I'm having some problem with my installed pods. They are not pulling the most recent (bug-fixed) version of their libraries from Github, and hence my Xcode compiler is full of warnings. I don't understand how Cocoapods works an entirely, and I'm wondering if anyone can clear it up.

  1. How does Cocoapods know when a new version of a library is available?

  2. What is required for Cocoapods to retreive the latest version via the

    sudo pod install
    

    comand?

  3. How often and for what reason does a podspec need to be updated? Does it need to be updated by the author of the podspec only or by anyone?
like image 768
zakdances Avatar asked Nov 30 '12 01:11

zakdances


2 Answers

Cocoapods are usually linked to a specific repository tag and version, so looking at AQGridView we can see two versions, version 1.2 refers specifically to the commit commit => 'f6c5589a6dabfff693fc7def7342327b9b0df3f9 whilst 1.3 differs. If the first time you ran a pod install 1.2 was the last version you would always get version 1.2 so as to not break backwards compatibility.

If you wanted to update to version you could run pod update which would check your existing podspec file and look for the latest versions ( on cocoapods! ) and use those.

If you wanted to use cocoapods but access the latest version specifically for one there is a wiki page saying how to do it here

So with that down,

  1. When someone updates the Specs repo the pods on your computer doesn't know this instantly, you can run pod repo update to ensure you're at the latest. I expect it auto checks every so often.

  2. Mentioned above, if you run pod update it will use the latest podspec versions

  3. Podspecs are updated as often as people want their libraries to have a version number, ideally whenever you release a point release you should also submit a corrosponding podspec to the repo and then everyone knows they can update. It is quite often updated by volunteers, but we do get authors updating their own libraries.

like image 199
orta Avatar answered Oct 23 '22 13:10

orta


pod install does not install the newest versions! Using the newest version by default is a bad idea. You should always specify the exact versions or use the pessimistic version constraint (~>).

To get notified about new versions you can use VersionEye. You can directly follow pods to receive email notifications as soon updates are available. In additional to that it can directly monitor your GitHub repository and notify you about out-dated pods in your project. That is the most convenient way. You can read more here.

if you get the notification for a new version you should first check the version number. If the pod project is using http://semver.org/ you can already on the version number see if you can update without breaking your build. In the worst case it's a major release, which very likely will break your build. In that case you have to check the change logs and the migration path. If you wanna learn about how to update right, check out the slides to continuous updating.

like image 4
Robert Reiz Avatar answered Oct 23 '22 13:10

Robert Reiz