简体   繁体   English

iOS:如何从我现有的项目中制作一个 pod? 代码

[英]iOS: How to make a pod from my existing project? XCode

I have a project (framework) including pods, frameworks, bridging headers and many other files with various types.我有一个项目(框架),包括 pod、框架、桥接头和许多其他各种类型的文件。 I want to make it accessible using cocoapods and can be easily add to other projects.我想使用 cocoapods 使其可访问,并且可以轻松添加到其他项目中。 I read many tutorials but non of them mentioned how to include all files of project and all dependencies.我阅读了很多教程,但没有一个提到如何包含项目的所有文件和所有依赖项。 I found this:我找到了这个:

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

to add in podspec file but how to add my other files with many different file extensions?添加 podspec 文件,但如何添加具有许多不同文件扩展名的其他文件? How to properly make a big XCode framework a pod?如何正确地将一个大的 XCode 框架变成一个 pod?

You can easily include multiple wildcard expression in s.source_files in your Podspec, like this:您可以轻松地在s.source_files中包含多个通配符表达式,如下所示:

s.source_files = "Dir1/**/*.swift", "Dir2/**/*.swift", "Dir3/**/*.{h,m,swift}"

Once you've set up your new pod like this, you can include it using像这样设置新 pod 后,您可以使用

pod "YourNewPod", :path => ".../where/ever/your/pod/lives"

into your respective projects.进入您各自的项目。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM