Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using local copy of a framework in podfile if exists

I have a framework and a project where I'm using my framework in. I'm trying to use the framework that is locally built during development. Is there a way to do something like:

if my-local-library-path exists, do this:

pod 'MyLibraryName', :path => "my-local-library-path"

else, do this:

pod 'MyLibraryName', git: 'https://github.com/mygithuburl', tag: '0.0.1'
like image 836
iamkaan Avatar asked Oct 17 '16 09:10

iamkaan


People also ask

What is use frameworks in Podfile?

use_frameworks! in the Podfile means that we want the listed frameworks to be dynamically installed instead as static frameworks. Thank you but please give more details about dynamically install vs static install.

How do I use CocoaPods with my internal iOS frameworks?

If you've used CocoaPods before, you probably know that the usual way to get started using it is by running pod init in the directory that contains the . xcproject file. Running this command creates a workspace that CocoaPods can use to manage the dependencies.


1 Answers

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
like image 155
Eric Aya Avatar answered Sep 24 '22 02:09

Eric Aya