Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode how to exclude FOLDERS from compilation?

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?

like image 262
Nik Kov Avatar asked Jul 20 '16 09:07

Nik Kov


People also ask

How do I show hidden files in Xcode?

To show hidden files in the Finder, hold down the Command and Shift keys and press the period (.) key. If you navigate to your project folder, you should see the git ignore file. Press Cmd-Shift-Period to go back to hiding the invisible files. After creating the git ignore file, add it to your repository. In Xcode choose Source Control > Commit.

How do I exclude specific files from deployment?

If you know which files you want to exclude ahead of time, and the exclusion applies to all destination environments, you can simply set the Build Action of each file to None. To exclude specific files from deployment. In the Solution Explorer window, right-click the file, and then click Properties.

How do I exclude specific files and folders from a project?

Excluding Specific Files and Folders 1 In the Solution Explorer window, right-click the file, and then click Properties. 2 In the Properties window, in the Build Action row, select None. More ...

How do I exclude a folder from compilation in typescript?

Use the exclude option in your tsconfig.json file to exclude a folder from compilation in TypeScript. The exclude option changes what the include setting finds and defaults to node_modules and bower_components. The example above uses the include option to specify a pattern to include in the codebase.


2 Answers

From looking at the post you link to. Here is how you do it:

  1. Go to Build Settings.

  2. Press the plus button and select "Add User-Defined settings"

enter image description here

  1. Give the new field the name of EXCLUDED_SOURCE_FILE_NAMES.

enter image description here

  1. Add the path to the folder: <Path>/FolderToIgnore/*. The asterisk denotes all the file in the folder.

enter image description here

That should do it.

Note: Make sure you add this to the right target.

like image 134
Caleb Kleveter Avatar answered Sep 19 '22 23:09

Caleb Kleveter


xcode 9.2

Build Settings> Build Options> Excluded Source File Names

enter image description here

like image 29
1mike12 Avatar answered Sep 21 '22 23:09

1mike12