I am trying to use the Info.plist preprocessing available in Xcode so that I can embed the last git commit id in the Info.plist application. It works fine in Xcode 3 using the technique described here: http://www.cimgf.com/2011/02/20/revisiting-git-tags-and-building/ However, when I try to do this in Xcode 4 it seems that no preprocessing is performed after the first build.
What I see:
- Starting from scratch when creating my goal, InfoPlist.h is created with the correct contents, the goals are built and run successfully, and I can access the value at runtime.
- Create a new commit to change the HEAD commit ID.
- Create my target again, InfoPlist.h updated to have a new commit identifier, target build and launch successfully, however the value in the info dictionary is the previous commit identifier.
Xcode seems to run the build step of the script, but does not pre-process my Info.plist using the cached version. Any thoughts on how to fix this?
I tried to remove InfoPlist.h as a post-build step so that it was always the new modified file, but that didn't matter.
Update: Performing a clean and then building again calls the correct value. However, I do not need to clear my goal every time I commit.
source share