jensmeder / Phoenx

A ruby gem to automate Xcode project generation.
https://rubygems.org/gems/phoenx
MIT License
18 stars 3 forks source link

Additional optional file filter 'excludedsources' #30

Closed karstenlitsche closed 7 years ago

karstenlitsche commented 7 years ago

I've tried to use phoenx to generate a framework target and its unitest target from one folder. Currently I use the following lines: framework.sources = ["SourcesFramework/**/*[!c].{h,m,c,swift}"] test.sources = ["SourcesFramework/**/*Spec.{h,m,c,swift}"]

Example: bildschirmfoto 2017-01-29 um 14 31 08 The files *.Spec are unittest code, the other files are framework code. Now I see a unit test file directly below the matching code file. I do not have to manage a second file structure, I can take a look into the specification without searching the unit test first and i see that StoredBoolSpec.swift is missing!. This is amazing and only possible with phoenx!

BUT: It was only possible for me by excluding all files ending with 'c' 😒 I didn't find a better way to exclude all files ending to 'Spec'. This doesn't work: framework.sources = ["SourcesFramework/**/*[!Spec].{h,m,c,swift}"] framework.sources = ["SourcesFramework/**/*[!S][!p][!e][!c].{h,m,c,swift}"] I think, the possibilities to exclude files are currently very limited. Maybe you have a better idea.

I searched for the problem and found stackoverflow. So I think we need an additional excludedsources. Example: framework.sources = ["SourcesFramework/**/*.{h,m,c,swift}"] framework.excludedsources = ["SourcesFramework/**/*Spec.{h,m,c,swift}"] test.sources = ["SourcesFramework/**/*Spec.{h,m,c,swift}"]

What do you think about this feature?

simonseyer commented 7 years ago

Sorry for the late reply. Agree. Will take a look.

The following file lists should be included: