Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Preprocess strings file during Xcode build

I know there's a way to preprocess my info.plist file, but is there a similar way to process strings files inside my Settings.bundle?

My problem: I have an iPhone app and I want the the user to know about the currently installed version. I do this by displaying it in the apps settings. Now every time i change the bundle version in my info.plist i also have to change the version in the Root.strings in the Settings.bundle. I could run a script action that updates it, but it would be nice to use the preprocessor since I could do even more fun things with it.

Thanks!

like image 846
stigi Avatar asked Nov 05 '22 13:11

stigi


1 Answers

The preprocessor XCode runs on all string-files is copystrings. It resides in /Developer/Library/Xcode/Plug-ins/CoreBuildTasks.xcplugin/Contents/Resources. It's a simple ruby script, but it dosen't support any preprocessing/macro-expansion.

You could of cause extend the script, but then you would be easier off with a different script running in a run script build phase, as you already suggested.

like image 176
tonklon Avatar answered Nov 12 '22 16:11

tonklon