How to Use Local-Only Project via Cocoapods

How to create a pod with cocoapods for local library

Just pass the local path to s.source, like s.source = { :git => "/Users/user/Dropbox/Library/UIView+Helper", :tag => "1.0.0" }

The dependencies must use version control like "git".

Podfile: Path of local pod relative to Projectpath possible?

Yes there is a way to do that, I have a project that use cocoapods and have custom pods in it, in the folder where you have your PodFile put your libraries folder and then modify your podFile to

pod 'ObjCPod', :path => 'libraries/LocalPod/'

Should work,
Hope this helps

Using local copy of a framework in podfile if exists

Since a Podfile is actually Ruby code, let's check if the file exists:

if File.exist?("complete-path-to-a-library-file")
pod 'MyLibraryName', :path => "my-local-library-path"
else
pod 'MyLibraryName', git: 'https://github.com/mygithuburl', tag: '0.0.1'
end

CocoaPods use locally modified Pods

Oh. It was right in the documentation here.

pod 'YourCustomPod', :path => 'relative/path/...'

Cocoa Pods: Local Pod install issue

By the Cocoapods Documentation, it seems that .zip files are only unarchivable via http resources:

Using HTTP to download a compressed file of the code. It supports zip, tgz, bz2, txz and tar.

So this would work:

s.source = { :http => 'https://example.com/MI_SDK_DEVELOPMENT.framework.zip' }

This would not:

s.source = { :path => './LocalPods/MI_SDK_DEVELOPMENT.framework.zip' }

How to use CocoaPods with multiple Framework subprojects

I think you can also get around this by just making FrameworkA and FrameworkB into local (static library) pods and it will de-duplicate everything for you and integrate it into the host app properly.

Examples: https://github.com/rob-keepsafe/PodFrameworksIssue

  • master branch shows duplicate classes and umbrella frameworks like you have
  • deduped branch makes the internal dynamic frameworks into local pods (as static libs) to de-dupe and still link in the dependencies

How does CocoaPods work

CocoaPods does a whole lot behind the scenes to make everything you're talking about work. On a relatively high level the actual 'Pods' are managed in a repo that lives on Github here. This is where 3rd party library vendors submit their 'Pods' to work with CocoaPods. You'll notice that if you search for a Pod using the command line tool with pod search AFNetworking you will see all the available Pods matching your search term.

As far as Github vs other sites goes even though the repository full of CocoaPods specifications lives on Github, CocoaPods itself uses just plain old Git to pull down the source from the given repository. Because of this you could make specs from any git repo hosted on any site. We also support svn, mercurial and just plain old http(s). If you're interested in how the specs work overall you can look at some in the specs repo you can open them from ~/.cocoapods/repos/master on your local machine or edit one directly with pod spec edit AFNetworking from the command line.



Related Topics



Leave a reply



Submit