I am collaborating on a iOS project, and the team is using Xcode. The issue with Xcode is that it doesn’t do any kind of #import management.
The challenge is to write a script that simply checks the import and searches the file for that class. If not present, remove that import. This is naive, since that imported file might contain other headers, variables, … etc, that are needed, but for the purposes of getting this over quickly, we will overlook that part.
5:11 pm: START!
Obviously it’s gonna be python…
Instead of defining a function that taken a path pointing to a file, I should make it take a string, so I can easily test it when I am done!
I am slow… And I wish I used PyCharm for this, not sublime.
Anyways, v0.0.0.1 is working!
I think it is done, and ready to be hooked with a “crawler”.
Time to test!!
Tested… found so many bugs… Try to spot them. Time to run this beast!
Fail. This is the worst idea I had ever. Xcode refused to compile anything when it saw the #import “blahblahUNUSED.h”. The premise was to comment it out type of deal, but it doesn’t work like commenting it out.