I saw this and answers in stackO, but didn't find how to exclude folders.
I have 3 folders with a lot of .h , .m and .mm and i need to exclude them temporary, but not to remove references. How can i do that?
I saw this and answers in stackO, but didn't find how to exclude folders.
I have 3 folders with a lot of .h , .m and .mm and i need to exclude them temporary, but not to remove references. How can i do that?
This answer covers only how to exclude the files from the build or the matching file patterns.Exclude from the path or the folder has currently not been implemented in the Xcode
editor
Add Build Setting
Add User Defined Settings
for this select the project for which you want to add the user defined settings.EXCLUDED_SOURCE_FILE_NAMES
or
You can use the File Inspector and in the target membership simply
uncheck
the file which you do not want to include in your buildSimilarly the same thing can be done compile sources category where you can
select the file
which you want toadd
to yourbuild
.From looking at the post you link to. Here is how you do it:
Go to Build Settings.
Press the plus button and select "Add User-Defined settings"
EXCLUDED_SOURCE_FILE_NAMES
.<Path>/FolderToIgnore/*
. The asterisk denotes all the file in the folder.That should do it.
Note: Make sure you add this to the right target.
xcode 9.2
Build Settings> Build Options> Excluded Source File Names
Can't comment, but wanted to note that, unless I'm doing something wrong, when using the
EXCLUDED_SOURCE_FILE_NAMES
build setting as explained in the other answered, excluding a folder using something like*/Folder/*
won't exclude anything within sub-folders ofFolder
, but only files within it directly. If you had another folder, eg./Folder/Subfolder/
, you'd have to include*/Folder/Subfolder/*
as well in order to exclude any files within it. At least this is the case in Xcode 10.3.Example:
*/Folder/*
would excludeitem.txt
andinfo.plist
, but notimage.png
.*/Folder/Subfolder/*
would excludeimage.png
.