Re: storing git version in the plist
Re: storing git version in the plist
- Subject: Re: storing git version in the plist
- From: Joel Reymont <email@hidden>
- Date: Tue, 04 Dec 2012 23:04:06 +0000
I spent a few hours on exactly this today and couldn't make it work.
It looked like Xcode was caching my version.h file somehow or, more likely, not running my version target on every build.
Are you saying that you can commit, make a small change to some target dependent on versioning, build and reliably get Xcode to preprocess the plist for you?
Also, I switched to an external build system target in the end. This made Xcode rerun the version target every time. The last git hash showed up in the intermediate plist file but not in the result of the built-in plist utility's expansion step.
--
http://www.linkedin.com/in/joelreymont
On Tuesday, December 4, 2012 at 10:35 PM, Wim Lewis wrote:
On 4 Dec 2012, at 11:04 AM, Joel Reymont wrote:
I tried adding a Run Script build phase to touch the unprocessed plist
for each target but I can only insert the build phase after the Target
Dependencies phase and the plist is (not)processed by then.
Xcode has always had trouble with this ... it's pretty frustrating.
Our solution is to have a separate target which consists only of a Run Script Phase that generates the version.h file, make the app target depend on that target, and use the generated version.h file in the preprocessed .plist. This way you can get the version.h generation to happen before the invisible "preprocess the plist" phase.
Remember to list the version.h file in the output files list of the run script phase that generates it --- the Xcode docs claim it uses that list when computing dependencies.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden