Cocoa podspec and path for dependency

后端 未结 2 1343
被撕碎了的回忆
被撕碎了的回忆 2021-02-07 01:02

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

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

thanks

2条回答
  •  日久生厌
    2021-02-07 01:38

    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
    

提交回复
热议问题