Cocoa podspec and path for dependency

Danilo picture Danilo · Sep 15, 2015 · Viewed 20.2k times · Source

how can I specify in podspec a local path for an dependency ?

like : s.dependency 'MyLibrary', :path => '../MyLibrary'

thanks

Answer

Loegic picture Loegic · Sep 15, 2015

You should use the :path keyword in your Podfile :

pod 'AFNetworking', :path => '~/Documents/AFNetworking/AFNetworking.podspec'

Tips: If you don't know the path, you can drag & drop the file in your Podfile and it will display it.

EDIT

I did not understand correctly what the OP was asking for, here is the correct answer:

  1. Put the local dependency inside your pod's folder root directory,
  2. In your Podspec file, just add s.ios.dependency 'YourPodName/YourPodDependencyFolder'

After that, create a subspace like so:

s.subspec 'YourPodName' do |ss|
ss.source_files = 'YourPodName/**/*.{h,m}'
end