Fixed PodSpec #12

Merged
merged 1 commit into from Jan 23, 2013

Projects

None yet

2 participants

@mmccroskey

Hi Francesco,

First off, thanks for the great work on FDStatusBarNotifierView! Thanks also for including a podspec in your repo. Unfortunately, your podspec is not currently a part of the official Specs repository, and when I tried to add it, there were some validation issues with the podspec itself.

I've fixed these issues, and have added a tag to the repo as required by CocoaPods. Please merge this pull request; once you do, I'll be able to publish your podspec to the official Specs repository, and then anyone using CocoaPods can easily find and use your code.

Thanks again for your work on FDStatusBarNotifierView; let me know if you have any questions.

Thanks!
Matthew

@frankdilo frankdilo merged commit e6df1ad into frankdilo:master Jan 23, 2013
@frankdilo
Owner

Thanks to you Matthew, for the contribution and the kind words :)

@mmccroskey

My pleasure :). Unfortunately, it seems that tags don't get merged when pull requests are merged (I didn't know that), and that means that CocoaPods won't be able to find your code.

So if you don't mind, please also add a v0.1.0 tag to the repository and push that to Github. You can do so with the following command (after cding to the repository on your local machine):

git tag -a v0.1.0 -m "Adding a 0.1.0 tag to help meet CocoaPods' requirements." && git push origin --tags

That command assumes that origin is the name you've given to the Github remote on your local machine. That's what gets set by default, so that's probably how you have things set up on your local machine, but if you want to be sure, you can double-check by typing git remote -v. You should see this:

origin git://github.com/frankdilo/FDStatusBarNotifierView.git (fetch)
origin git://github.com/frankdilo/FDStatusBarNotifierView.git (push)

If, instead of seeing the word origin at the beginning of those two lines, you see a different word (e.g. github), then use that word instead of origin in the command I list above. So for example, if, you type git remote -v and you see this:

github git://github.com/frankdilo/FDStatusBarNotifierView.git (fetch)
github git://github.com/frankdilo/FDStatusBarNotifierView.git (push)

instead of this

origin git://github.com/frankdilo/FDStatusBarNotifierView.git (fetch)
origin git://github.com/frankdilo/FDStatusBarNotifierView.git (push)

then you should add the tag using this command

git tag -a v0.1.0 -m "Adding a 0.1.0 tag to help meet CocoaPods' requirements." && git push github --tags

instead of this command

git tag -a v0.1.0 -m "Adding a 0.1.0 tag to help meet CocoaPods' requirements." && git push origin --tags

Apologies if that was long-winded, or if I told you things you already knew. I just want to make the process as painless as possible.

Let me know if you have any questions, and sorry to add another step to this process.

@frankdilo
Owner

Done.

@frankdilo
Owner

So, if a change the version in the podspec file, I also need to update the tag?

@mmccroskey

Yes; each time you change the version in the .podspec file, you should create a new git tag that points to the appropriate commit.

For example, say that you find a bug in FDStatusBarNotifierView. You fix that bug, commit that change, and push it to Github. According to semantic versioning, the versioning system that CocoaPods requires you to use, you have now created a new version of FDStatusBarNotifierView, namely version 0.1.1.

If you want that version of FDStatusBarNotifierView to be available via CocoaPods, then you need to do the following:

Create a git tag

Create a git tag that points to your latest commit (the commit where you fixed the bug), and give that tag a logical name

  • By convention, the tag would be named v0.1.1 or 0.1.1, but it can actually be anything you want (I'll explain that concept in detail in a moment)
  • To create the tag, type git tag -a [name of tag] -m "[message for tag]", where [name of tag] is the name you're giving to the tag (e.g. v0.1.1, 0.1.1, etc.) and [message for tag] is the message you type, explaining the tag (e.g. Fixed a bug)

Push the tag to Github

You've now created the tag locally, but you need to push it up to Github. To do so, type git push origin --tags (assuming that origin is the name of your Github remote (see earlier in this pull request for details)).

Update your .podspec file

Update your .podspec file, making two changes:
1. Change the value of the s.version property from 0.1.0 to 0.1.1
2. Change the value of the :tag key for the s.source property from v0.1.0 to the name of the git tag you just created above (e.g. v0.1.1, 0.1.1, etc.)

Commit and push the changed podspec to Github

Now you've updated the .podspec file, you need to make it publicly available.

Add the updated podspec to CocoaPods/Pods

There are a couple of ways to do this, documented here (see 'Sharing podspecs'). If you have any questions about this step (it can be confusing), feel free to ask me.

I mentioned above that, by convention, the new git tag would be named v0.1.1 or 0.1.1, but that it can actually be anything you want. As you might have figured out, the git tag is just the thing that CocoaPods uses to check out a particular version of your code; the name of the tag can be anything you want, as long as you specify it as the value of the :tag key for the s.source property in your .podspec file. So, for instance, your git tag could be named Bug Fix Number 1 instead of v0.1.1, as long as your .podspec looked like this:

Pod::Spec.new do |s|
  s.name         = "FDStatusBarNotifierView"
  s.version      = "0.1.1"
  s.summary      = "FDStatusBarNotifier is a UIView subclass that lets you display notifications using the space in which the status bar resides."
  s.homepage     = "https://github.com/frankdilo/FDStatusBarNotifierView"
  s.author       = { "Francesco Di Lorenzo" => "fradilorenzo92@gmail.com" }
  s.license      = { :type => 'MIT', :file => 'LICENSE'}
  s.source       = { :git => "https://github.com/frankdilo/FDStatusBarNotifierView.git", :tag => "Bug Fix Number 1" }
  s.platform     = :ios, '5.0'

  s.source_files = 'FDStatusBarNotifierView/*.{h,m}'
  s.frameworks = 'CoreGraphics', 'UIKit', 'Foundation'

  s.requires_arc = true
end

Hope that wasn't too long or confusing. Let me know if you have questions.

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