Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

When pointing to a github repo with Cocoapods, is there a way to specify a subfolder?

Tags:

ios

cocoapods

I'm using a fork of a repo that contains a larger project and an SDK in a subfolder. The podspec has a source_files property that configures the subfolder, but the top-level repo has no knowledge of the podspec, and so pointing to:

pod 'PodName', :git => 'https://github.com/owner/project.git'

... fails because there's no podspec in the root. Is there a way to specify using a subfolder when pointing Cocoapods to a git repo?

Something like:

pod 'PodName', :git => 'https://github.com/owner/project.git', :subfolder => '/subfolder/path/to/podspec'
like image 588
brandonscript Avatar asked Feb 18 '16 17:02

brandonscript


1 Answers

I was able to do this by pointing to the raw file on github and using the podspec option. Cocoapods is expecting the pod spec to be in the root directory with all of the :git => options but you can point directly to a file using the :podspec => option.

pod 'PodName', :podspec => 'https://raw.githubusercontent.com/owner/project/branch/subfolder/project.podspec'
like image 162
Rufus Avatar answered Nov 03 '22 19:11

Rufus