New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How can i add the private dependency to podspec file? #4921
Comments
You can't specify source requirements in the podspec, only a version requirement. |
@segiddins i see but if i do that, how the podspec understand my private repo? I just can add a public dependency ? |
Just add a normal dependency, the source used will come from the command line or the Podfile, depending on the command run. |
what the format i should use to run the command > pod repo push MyLib MyLib.podspec to add another source? |
the guy is asking about "private" pod. How we can add a private pod dependency into .podspec file? |
|
Adding a little more color to @orta's comment: https://guides.cocoapods.org/making/private-cocoapods.html |
@orta How does using the pod repo push command work with an example project using the pod that is using relative file paths? |
when you run pod lib lint you should config --sources=https://github.com/private-repo-name.git,and same when pod repo push ,like this pod lib lint name.podspec --sources=https://github.com/CocoaPods/Specs.git,192.168.0.100:Plutoy/Specs.git here is the article http://www.pluto-y.com/cocoapod-private-pods-and-module-manager/ |
Thanks! |
I am also having this same issue, |
Our Problem is, that the there is a private pod with the same name as a spec inside the master-spec-repo. Sure, I can pass the sources via the command line, but this does not solve the issue if you got naming conflicts. |
is there any update on this? |
@rahulOYO in that case, I guess we have to deploy our Podspecs to our private specs repo with |
I just advanced my pod use to need a hierarchy of private pods. As stated above, there is no way to specify a private path in a podspec, only a version. The task of defining a path is pushed to the users of those pods, just like regular use of private pods. I feel that is a big burden once the private hierarchy gets complex. My biggest issue is that if the pods were public, then the user wouldn't have to specify that pod relationship at all - it would just come with the pod install. Instead for private pod hierarchies, each podfile would need to know inside details of all the pods they use. That's a lot of complexity. Obviously once a pod is uploaded to GitHub and made private or public this issues is simplified. The git lint tools would have to strip out a private path. It sure seems this is a valid and important feature for CocoaPods to explore. |
@segiddins this issue should be re-opened or declared as feature request. Why specifiying podspec is allowed from Podfile: But not from from podspec dependency : How to deal with "non-public" dependencies in podspec file ? |
This issue should be re-opened. There should be a way of including a dependency that is on another Specs repo. |
Any movement here? |
Sure seems to be a big gap in what is an awesome reuse capability. I too was just wondering the status as I really need this feature. |
I don't think this is something which will ever get built because the current answer is the right abstraction and we don't need to make the concepts leaky. It's likely that if you're hitting this - it's because you've probably not read up enough on the responsibilities on how Podfiles, Podspec repos and Podspecs systems work together. If it's in your app: The podfile uses the ordering of sources to determine the podspec which gets picked up. If it's on the CLI (e.g. linting): there should be a flag to get the sources set up right for your case. |
My understanding is a
How is that leaky?
I haven't created any public pods but have many private pods and I have to perform these kludges to get a large interrelated system to work. Please enlighten me on how to perform what I believe is a simple example that every object oriented reuse library requires? Thanks |
Sounds to me like you need a private specs repo |
@orta can you please elaborate on what a "private specs repo" is? Basically how can I achieve what was described |
Please re-read this thread which has lots of links about private spec repos, or consult stack overflow / duckduckgo. Our issues are not a support forum and I'm afraid I don't have the spare time for CocoaPods like I used to. |
@konacurrents You're not alone. CocoaPods is a bit of a odd beast, both widely used but also feeling a bit tired. And it's written in Ruby, which just seems weird to me. "Your mom is weird", someone is probably going to reply :) Anyway - there seems to be a lot less support around the podspecs creation workflow vs the more common "create a Podfile for my project" workflow. While it is possible to throw a git repo into a Podfile and have everything work fine, in order to lint your podspec all of your dependencies have to been in a private specs repo (you can Google it) which means that someone has "pushed" it using |
I have had success with many private pods locally on my computer, and in my GitHub. But I cannot find a way to reference those in GitHub from other private pods (vs Podfile). I guess I can try to place a pod in the public space and go from there for my common types. I haven't tried that yet. I cannot find useful thanks. |
@konacurrents if you have a private artifact that needs to rely on private pods, that's totally doable by running your own podspec server which can actually be a git repo somewhere. I hadn't set that up myself but I worked on a big company where we had a huge app modularized on private pods (this was prior to SPM even existing) and the different modules were cocoapods in private repos that were "published" to a private I hope this helps |
It would be nice to see actual instructions for doing this. I've tried referencing my GitHub but I can't find |
This should be added to: https://guides.cocoapods.org/making/private-cocoapods.html In case this is too open source, and i can make an PR to add the details i would be happy to do so, just point me to the files. 😀 |
I try to add a dependency from private repo to podspec. But it doesn't work.
After run the command > pod repo push MyLib MyLib.podspec
[!] Invalid
MyLib.podspec
file: [!] Unsupported version requirements. Updating CocoaPods might fix the issue.from MyLib.podspec:16
-------------------------------------------
s.dependency 'ReachabilitySwift'
P/S: MyPrivateLib posted to the cocoapod via. https://guides.cocoapods.org/making/private-cocoapods.html
Nghia,
Thanks
The text was updated successfully, but these errors were encountered: