且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

在Cocoapods podspec中递归包含文件

更新时间:2023-11-21 14:11:46

source_files 属性使用 Ruby文件Glob语法。该模式必须相对于项目的根目录(即podspec文件),因此它应该对您有用:

The source_files attribute uses Ruby file glob syntax. The pattern must be relative to the root of your project (i.e., the podspec file), so this should work for you:

s.source_files = 'Library/src/**/*.{h,m}'

source 属性不是用于源代码文件,而是用于应从中检索代码的远程存储库(最常见的是Git存储库URL和标签)。有关更多信息,请参见 CocoaPods规范文档

The source attribute is not for source code files, but rather for the remote repository from which the code should be retrieved (most commonly a Git repository URL and tag). See the CocoaPods specification docs for more info.