Sean Danzeiser
Sean Danzeiser

Reputation: 9243

Force updating Cocoapod with same tag

I'm working on a private cocoapod and project using that cocoapod concurrently, and I'm having difficulty settling on the right workflow for keeping everything synchronized.

The problem i am encountering is this: If i make a change to my cocoapod project, I've found that the only way I can get my other project to pull those changes is if I create a new tag and change the version referenced by the pod spec. As a result, I'm getting stuck with many useless versions of my pod spec.

What I would prefer is to simply move my tag to the head of my cocoapod project and somehow re-pull the cocoapod. I've found that pod install and pod update do not seem to refresh the cocoapod in this circumstance.

Does anyone have any recommendations for concurrently working on a cocoapod and a project that uses it?

Upvotes: 12

Views: 4503

Answers (4)

hsiraaH
hsiraaH

Reputation: 35

@Emilie's comment is a way better solution than the other offered answers for this question. Here is her comment on the OP question in case you missed it.

When this happens to me I usually just remove the line from my Podfile, run pod install, re-add the line and re-run pod install. Maybe there is a better way but this one is pretty simple.

Upvotes: 0

You could also use the :head flag but you would still have to create the tags.

pod 'YourPod', :head

When running pod update the pod’s latest version spec would be used.

Upvotes: 2

Anthony
Anthony

Reputation: 2877

If you just point your podfile at your library's git repo it will just pull the default branch's latest.

pod 'InternalStuff', :git => 'https://github.com/YourGithub/InternalStuff.git'

Upvotes: 3

Pablosproject
Pablosproject

Reputation: 1424

We do the same internally in our team and we ended up by referencing the latest commit, instead of the tag. Here you've an example of a podspec:

Pod::Spec.new do |s|
  s.name         = "TTFacebook"
  s.version      = "0.0.1"
  s.summary      = "Tiltap wrapper around Facebook SDK 3.5"
  s.homepage     = "https://bitbucket.org/*****"
  s.license      = 'MIT'
  s.author       = { "Paolo Tagliani" => "[email protected]" }
  s.platform     = :ios, '5.0'
  s.source       = { :git => "[email protected].*****", :commit => "a8c276eec3372f2b088de0731a7808e4766b625d" }
  s.source_files  = 'TTFacebook/TTFacebook/*.{h,m}'
  s.requires_arc = true
  s.dependency 'Facebook-iOS-SDK','~>3.5'

end

Every time that we modify something in our library, we update our podspec with the latest commit.

Upvotes: 6

Related Questions