6

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

Alberto Schiariti
  • 1,546
  • 2
  • 15
  • 31

2 Answers2

10
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

Paul Beusterien
  • 27,542
  • 6
  • 83
  • 139
  • My fault. I didn't explain that I must write it in an "exclude form", because that target2 is variable. I can't simply choose what to include, because tomorrow I can add a target3, target4... and I don't want to add things there. I only want to write something like "pick targetX and exclude all other targets". – Alberto Schiariti Jan 15 '18 at 11:35
5

CocoaPods exclude_files

[CocoaPods]

Pattern: ** - Matches directories recursively.

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

The opposite is source_files[About]

yoAlex5
  • 29,217
  • 8
  • 193
  • 205