Making a CocoaPod from an existing Xcode project

我怕爱的太早我们不能终老 提交于 2019-12-18 14:11:05

问题


I've been trying to crack this with no avail so far. I have my Xcode Swift project with its github repository for source control. I would like to create a new CocoaPod with this project.

Ive gone through the CocoaPods documentation but nothing has worked as of yet and Im really confused by now, could someone please write the steps in order I need to do for making that new pod from my existing Xcode Project which already has a Github repository linked to it.

Thanks in advance!


回答1:


Taken from the Cocoapods documentation:

$ pod spec create YourProject
$ edit YourProject.podspec

Then in editor replace s.source_files = "Classes", "Classes/**/*.{h,m}" with

s.source_files = "Classes/**/*.{swift}"

Then run until you pass all tests..

$ pod spec lint YourProject.podspec

Thats basically all.

You can test this Podspec in real life by creating a new demo app and follow the 9 steps from Anbu.Karthik.

In the created podfile add something like:

pod 'YourProject', :path => '/Users/you/work/YourProject'

The path should point to the dir containing the podspec file. Run pod install again.



来源:https://stackoverflow.com/questions/31445691/making-a-cocoapod-from-an-existing-xcode-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!