本文介绍了从现有的Xcode项目制作CocoaPod的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

到目前为止,我一直在努力解决这个问题。我有我的Xcode Swift项目及其github存储库用于源代码控制。我想用这个项目创建一个新的CocoaPod。

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.

我已经浏览了CocoaPods文档,但是到目前为止还没有任何工作,我现在真的很困惑,有人可以请按照我现有的Xcode项目制作新pod的顺序编写步骤,该Xcode项目已经连接了Github存储库。

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.

提前致谢!

推荐答案

取自:

$ pod spec create YourProject
$ edit YourProject.podspec

然后在编辑器中替换 s.source_files =Classes,Classes / ** / *。{h,m} with

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 Peanut.podspec

基本上都是。

你可以通过创建在现实生活中测试这个Podspec一个新的演示应用程序并按照Anbu.Karthik的9个步骤进行操作。

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

在创建的podfile中添加如下内容:

In the created podfile add something like:

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

路径应指向包含podspec文件的目录。再次运行 pod install

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

这篇关于从现有的Xcode项目制作CocoaPod的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-17 12:00