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

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

本文介绍了Podspec-排除子文件夹之外的所有文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这样的结构

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

我只想包含 target2例如,排除其他目标。我如何写spec.exclude_files?

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}'

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

推荐答案

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/**' ]

这篇关于Podspec-排除子文件夹之外的所有文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 03:33