Podspec - Exclude all but a subfolder

别等时光非礼了梦想. 提交于 2019-12-13 03:49:16

问题


I have a structure like this

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

And I want to include only "target2" for example and exclude the other targets. How I write the spec.exclude_files?

I found this example for excluding files, but I can't understand how to write it for whole folders.

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


回答1:


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

or for the case you ask about, more simply:

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

Reference




回答2:


CocoaPods[About] 1.8.0.beta.2

Pattern: ** - Matches directories recursively.

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

The opposite is source_files[About]



来源:https://stackoverflow.com/questions/48224133/podspec-exclude-all-but-a-subfolder

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!