Search code examples
xcodecocoapodspodspec

Cocoa podspec and path for dependency


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

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

thanks


Solution

  • 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