Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to disable Xcode indexing for certain files or subproject?

We have a quite large project, which contains both Objective-C and C++ files. All of the C++ files are used during build, but only some of them are ever opened using Xcode, and there are lots of them that should never be opened at all. But Xcode adds all files' information into the index, as a result our .xcindex file has a size of about 40 GB. Obviously, this is very inconvenient. My question is: is there a way to disable indexing for some part of the project? For certain source files, group of files, or whole subprojects. I tried setting explicitFileType for some sources to "compiled". It disables indexing for them, but they also won't compile. Build system doesn't know what to do with them ("warning: no rule to process file"), even though they are listed in "Compile Sources" build phase. Adding a custom rule for these source files doesn't work either - CompileC command runs, but it has "?" instead of "c++" argument and all clang command line flags are lost. Any suggestions would be much appreciated.

like image 421
mike Avatar asked Mar 17 '16 16:03

mike


1 Answers

Any suggestions here?

I have a similar issue with CocoaPods project. There are a huge amount of pods that are all indexing. It takes ages. My Xcode freezing for good after each pod install. Autocomplete also works badly. I wonder if there is a solution to prevent indexing private parts of all pods?

Best regards


Update for CocoaPods: Finally, I've solved my problem by developing the utility 🏈 Rugby. In the current version, Rugby can cache all remote pods dependencies and remove their targets from the Pods project. While building targets outside of Xcode I can disable indexing and use prebuild frameworks. Maybe it can help someone.

like image 121
SwiftyFinch Avatar answered Oct 19 '22 23:10

SwiftyFinch