Podspec - 排除除子文件夹之外的所有文件夹

时间:2018-01-12 10:20:52

标签: ios xcode cocoapods cakefile

我有这样的结构

target_files/
├──target1/
├──target2/
└──target3/

我想仅包含“target2”,并排除其他目标。我怎么写spec.exclude_files?

我找到了这个排除文件的例子,但是我无法理解如何为整个文件夹编写它。

spec.exclude_files ='_ private / ** / *。{h,m}'

2 个答案:

答案 0 :(得分:1)

spec.source_files = [ 'target_files/**' ]
spec.exclude_files = [ 'target_files/target1/**', 'target_files/target3/**' ]

或者您提出的问题更简单:

spec.source_files = [ 'target_files/target2/**' ]

Reference

答案 1 :(得分:0)

CocoaPods [About] 1.8.0.beta.2

Pattern: **-递归匹配目录。

s.exclude_files = 'target_files/target1/', 'target_files/target3/'

相反的是source_files [About]