Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to rename a cocoapod

Tags:

ios

cocoapods

I have a published Cocoapod, say it's named abc-sdk, I wish to fix its name (capitalization) to Abc-SDK. Is it possible? I tried changing the s.name in the podspec (and the podspec file name capitalization as well) but when I run pod trunk push I get: [!] The following validation failed: - Name is already taken. What's the right way to do it?

like image 313
mindbomb Avatar asked Mar 01 '15 03:03

mindbomb


People also ask

How do I switch from submodules to CocoaPods?

< Switching from submodules to CocoaPods 1 Install CocoaPods, if you have not done so already 2 Create your Podfile 3 Remove the submodule reference 4 Add a reference to the removed library in your Podfile 5 Run pod install More ...

How does CocoaPods honour the pod version?

CocoaPods will honour the Pod version in Podfile.lock unless the dependency is updated in the Podfile or pod update is called (which will cause a new Podfile.lock to be generated). In this way CocoaPods avoids headaches caused by unexpected changes to dependencies.

Do I need to install CocoaPods If I clone the repo?

After cloning the repo, the project can immediately build and run, even without having CocoaPods installed on the machine. There is no need to run pod install, and no Internet connection is necessary. The Pod artifacts (code/libraries) are always available, even if the source of a Pod (e.g. GitHub) were to go down.

How do I add a cocoapod to my project?

Add a CocoaPod by specifying pod '$PODNAME' on a single line inside your target block. Save your Podfile. Open the MyApp.xcworkspace that was created. This should be the file you use everyday to create your app. Integrating CocoaPods with an existing workspace requires one extra line in your Podfile.


2 Answers

Hrm, so yes this can be changed (via a PR to the Specs repo), but it is not encouraged as it will break everyone's Podfile.

One other way to deal with this is to create a new Podspec outright and to use deprecated_in_favor_of on the older one to point to the new one. E.g. AbcSDK instead of Abc-SDK.

like image 138
orta Avatar answered Oct 21 '22 07:10

orta


Create and push a new spec first, then deprecate the old spec in its entirety. CocoaPods now supports the following command (as of at least 1.0.0.beta.8):

pod trunk deprecate OLD_SPEC --in-favor-of=NEW_SPEC

https://github.com/CocoaPods/cocoapods-trunk/issues/31

like image 40
Wayne Avatar answered Oct 21 '22 06:10

Wayne