Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Podfile: Path of local pod relative to Projectpath possible?

Tags:

I am trying to add local pods to my objective c iOS project. Is there a way to use the rootpath of my project as relative path? The only way I got it to work is by using something like this:

pod 'ObjCPod', :path => '~/Documents/iOS-Projects/MyApp/libraries/LocalPod/' 

This wouldn't work if I moved the Project folder or tried to build the project on another machine.

I would like to have something like this:

pod 'ObjCPod', :path => '$(SRCROOT)/libraries/LocalPod/' 

Is there a way to do that?

like image 878
Snerps Avatar asked Jun 30 '17 09:06

Snerps


People also ask

Where do you put pods in Podfile?

Run open Podfile. Which opens the Podfile in textEdit. Add pod'CorePlot', '~> 1.4' to it and save. Run pod install -- NOTE* that is **pod update if already installed.

Where is the Podfile located?

The Podfile is located in the root of the Pods project. An easy way to open it is via "Open Quickly" (Shift Cmd O) typing Podfile.

What is Podfile and Podfile lock?

Podfile. lock is used to make sure that every members of the team has the same versions of pods installed on the project. This file is generated after you run the command: pod install. It gets updated when you run pod install or pod update.


2 Answers

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

like image 187
Reinier Melian Avatar answered Dec 06 '22 21:12

Reinier Melian


If you would like to develop a Pod in tandem with its client project you can use :path.

pod 'Alamofire', :path => '~/Documents/Alamofire' 

Using this option CocoaPods will assume the given folder to be the root of the Pod and will link the files directly from there in the Pods project. This means that your edits will persist between CocoaPods installations. The referenced folder can be a checkout of your favourite SCM or even a git submodule of the current repo.

Note that the podspec of the Pod file is expected to be in that the designated folder.

like image 23
Paresh Mangukiya Avatar answered Dec 06 '22 20:12

Paresh Mangukiya