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

Alb*_*iti 5 xcode ios cocoapods cakefile

我有这样的结构

target_files/
???target1/
???target2/
???target3/
Run Code Online (Sandbox Code Playgroud)

例如,我只想包括“target2”并排除其他目标。我如何编写spec.exclude_files?

我找到了这个排除文件的例子,但我不明白如何为整个文件夹编写它。

spec.exclude_files = '_private/**/*.{h,m}'

Pau*_*ien 7

spec.source_files = [ 'target_files/**' ]
spec.exclude_files = [ 'target_files/target1/**', 'target_files/target3/**' ]
Run Code Online (Sandbox Code Playgroud)

或者对于您询问的情况,更简单地说:

spec.source_files = [ 'target_files/target2/**' ]
Run Code Online (Sandbox Code Playgroud)

参考


yoA*_*ex5 5

CocoaPods 排除文件

[可可豆]

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

s.exclude_files = 'target_files/target1/', 'target_files/target3/'
Run Code Online (Sandbox Code Playgroud)

相反的是source_files[关于]