how to remove / disavow a private podspec? - cocoapods

Recently, I found a problem in a public cocoapod, and I was impatient to wait for the fix. Good thing, too, because it took about 4 weeks to get my PR accepted.
So, my solution was to fork the public pod. I'm already using a private repo for some of my company's private pods, so I modified my forked podspec file, and did a pod repo push to my local repo.
In my podfile, I modified the "pod" line like so:
pod 'PublicPod', :git => "https://github.com/MyCompany/ForkedPublicPod.git
Recently, my PR was accepted, so I removed the "git" dependency on the "PublicPod" line, telling Cocoapods to use the "normal" pod, instead of my private pod (or so I thought). However, I'm being told that cocoapods has Found multiple declarations for 'PublicPod'.
So, I don't need my forked pod to be active anymore, but I do have other private pods, so I can't just removed the source line from my Podfile.
I just want to forget about my private pod, and have it just not be seen or available anymore.

When I faced the similar problem. I haven't found any command to do this via pods, so I completed this task manually. I removed my local pod the next way:
Remove folder with all podspecs from my private pod. I think, this is the main step because no podspecs - no pod.
Run pod repo update [repo_name] to stay your local cached repo synced with remote repo.
Since I don't need my current sources for the removed pod, I delete them too.
I use tags for pod versioning, so I remove all tags connected to my pod
Additionally you can clean pod cache (to be ensure, that you really use remote pod) with pod cache clean <pod_name> --all. Be careful, if you miss pod_name, this command will clear all your cache (all pods)!
I suppose, the first two steps are enough. But I wanted to completely remove the private pod.

Related

Rename default "Example" directory in pod init

I am following this tutorial in creating a private pod: https://medium.com/practical-code-labs/how-to-create-private-cocoapods-in-swift-3cc199976a18 . When I run the following command, I can see an "Example" directory:
pod lib create HandyExtensions
"Example" is only useful to me the first time I run the command. I'd like to change it to something more meaningful, like "Workspace". How can I rename this folder to ensure it plays well with Xcode?
(I've tried many things ranging from renaming to cleaning workspaces. However, I always come back to the error of : No such module : when I try to test my private pod. A step by step solution, or even a command would help me resolve this annoyance )
pod lib create is really only intended for initial creation.
pod gen is more useful for building workspaces for testing already existing pods. See https://github.com/square/cocoapods-generate for usage instructions.

Log out Pod Trunk Session

Like the title reads, say I authenticate myself by running this:
pod trunk register myemail#email.com 'FirstName LastName' --description='my computer'
How could I log myself out? Also, is there any way I could log out a specific session that came up from running pod trunk me?
You can log out with pod trunk me clean-sessions
$ pod trunk me clean-sessions
By default this will clean-up your sessions by removing expired and unverified
sessions.
To remove all your sessions, except for the one you are currently using, specify
the `--all` flag.

pushing private pod

I am creating my own private pod. I have complete all step. But in last step when we call
pod trunk push AffleChat_msy1.podspec
We got error like
[!] Source code for your Pod was not accessible to CocoaPods Trunk. Is
it a private repo or behind a username/password on http?
I think what you are searching for is:
pod repo push [REPO_NAME] [POD_NAME].podspec
Before, you should consider that you need to tag your current version:
git tag ‘1.0.1’
Also pushing that tag.
git push --tags`
The --tags command pushes all tags, even unwanted. Push just one tag by: How to only push a specific tag to remote?
git push origin 1.0.1
See this medium article to get a good overview about how to update private pods.

Trunk push error: "Source code for your Pod was not accessible to CocoaPods Trunk"

I'm having trouble pushing an update to a pod (Audiobus).
"pod trunk push" seems to successfully validate (downloads the git repository, builds, etc), but then drops out with a 403 Forbidden error when doing a POST to /api/v1/pods with the podspec content, along with the message:
"Source code for your Pod was not accessible to CocoaPods Trunk. Is it a private repo or behind a username/password on http?"
I have verified that I'm registered ("pod trunk me" shows I am logged in with correct email address, an owner of the pod).
The repository once required HTTP authentication, but after seeing the above error, I disabled auth. I've verified that there's now open access to the git repository by cloning the repository from a separate, unauthenticated machine (git clone https://developer.audiob.us/download/SDK.git test --single-branch --depth 1 --branch 2.2).
Is this a bug in trunk.cocoapods.org? What am I missing?
Cheers in advance,
Michael
Make sure to make your repo commit tag name the same version name you have on your package podspec file.
I'm surprised by this also, this has been running for a few weeks now and this is the first time a problem has come up. When I run the command locally I don't see a problem. I don't know if you've edited the question, but I had a reference to https://developer.audiob.us/download/SDK.git/?url=download/SDK.git which didn't work with the git ls-remote. Perhaps it doesn't redirect like git clone does?
Any one who may come upon this issue but the other answer does not help. Make sure you have the correct branch in your podspec. Having the incorrect branch will also cause this error to occur.

How to update an old pod, for cocoapods?

Question
If you pushed a pod on cocoapods with the old process, how to update it (with the new process)?
Details
By old process, I mean with github and Pull Requests.
By new process, I mean the new way of updating pods, such as described here.
Steps to be followed:
Claim your pod: https://trunk.cocoapods.org/claims/new. Do it again. If it is already done, it will tell you what is the email associated with this pod.
Trunk register your computer : $ pod trunk register YOUR_MAIL#COMPANY.COM 'your name' --description='macbook pro' and click on the link sent by email to confirm. Be sure to put the same email as the one used for claiming (so, that's why you should do the provisos step).
Go the directory of your pod. Update it if necessary, and tag the last version on github (same version number as in the podspec).
Then $ pod lib lint to check the syntax, etc. of your pod. I don't know if this can be overpass.
Then, finally $ pod trunk push YourPod.podspec.
It worked with my pod, hope it will work for you !

Resources