how can I specify in podspec a local path for an dependency ?
like : s.dependency 'MyLibrary', :path => '../MyLibrary'
thanks
After you have initially installed CocoaPods into your project, you can add new dependencies (or remove unused ones) by editing the Podfile. Then simply run pod install again.
Podspecs are ruby files. The Specs Repo is the repository on GitHub that contains the list of all available pods. Every library has an individual folder, which contains sub folders of the available versions of that pod. See the Private Pods section for an explanation of the Spec repo's file structure.
CocoaPods refers to a dependency as a pod hence the name Podfile. Because CocoaPods took inspiration from Bundler, the syntax and format look similar to that of a Gemfile. You can manually create a Podfile with a text editor or execute the pod init command at the root of your Xcode project.
To install the pods, do one of the following: Place the caret at the code line where you add the pod, press ⌥ ⏎ , select Install, and press ⏎ . Click Install pods in the top-left corner of the editor window. From the main menu, select Tools | CocoaPods | Install.
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:
s.ios.dependency 'YourPodName/YourPodDependencyFolder'
After that, create a subspace like so:
s.subspec 'YourPodName' do |ss| ss.source_files = 'YourPodName/**/*.{h,m}' end
I can't put the other libraries in the root of my library, these are inside the parent because are shared with other project, but unfortunately without use the pods, and I'm trying to use the pods for all, and I already configured the podspec for all libraries.
I'm trying to do something like this written below, but do not appear to work:
Pod::Spec.new do |s| s.name = 'MyLibrary' s.platform = 'ios' s.ios.deployment_target = '7.1' s.source_files = 'Classes/**/.{h,m}' s.resource = 'Classes/resources/*.*' s.requires_arc = true s.dependency 'AFNetworking' s.dependency 'SharedLib' s.subspec 'SharedLib' do |ss| ss.source_files = '../SharedLib/Classes/**/*.{h,m}' s.resource = '../SharedLib/Classes/resources/*.*' ss.ios.framework = 'AVFoundation' end end
thanks for all.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With