我想创建一个基于某些私有代码的本地podspec.我似乎无法使用'source'属性,因为它不起作用.我可以使用'source_files'属性,但它不会递归地包含文件.所以使用看起来像这样的目录
Library
/src
/Core
/Audio
/Graphics
Run Code Online (Sandbox Code Playgroud)
我的podspec看起来像这样:
Pod::Spec.new do |s|
...
s.source = 'src' # this does not work.
s.source_files = 'src' # this only includes the files in src, and not in any of the Core, Audio or Graphics folders.
Run Code Online (Sandbox Code Playgroud)
我想要指定'-r'标志.我尝试过使用通配符,但没有运气.
Ada*_*arp 36
该source_files属性使用Ruby文件glob语法.模式必须相对于项目的根目录(即podspec文件),因此这应该适合您:
s.source_files = 'Library/src/**/*.{h,m}'
Run Code Online (Sandbox Code Playgroud)
该source属性不适用于源代码文件,而是适用于应从中检索代码的远程存储库(最常见的是Git存储库URL和标记).有关详细信息,请参阅CocoaPods规范文档.
CocoaPods 源文件
spec.source_files = 'Classes/**/*.{h,m,swift}', 'More_Classes/**/*.{h,m,swift}'
Run Code Online (Sandbox Code Playgroud)
文件模式:
* - 匹配任何文件。** - 递归匹配目录。? - 匹配任何一个字符。[set] - 匹配集合中的任何一个字符。{p,q} - 匹配文字 p 或文字 q。\ - 转义下一个元字符。| 归档时间: |
|
| 查看次数: |
9843 次 |
| 最近记录: |