Re: Add variable from script during build
Re: Add variable from script during build
- Subject: Re: Add variable from script during build
- From: Chris Espinosa <email@hidden>
- Date: Fri, 20 Mar 2009 19:26:37 -0700
On Mar 20, 2009, at 6:19 PM, Trygve Inda wrote:
I have a two target app.
During the build of target A, I need to run a shell script which
will return
a text result. This result needs to be inserted in the Info.plist of
target
B.
So how can my shell script set something like ${MY_VAR} and then in
target
B's Info.plist I can have:
<key>MyKey</key><string>${MY_VAR}</string>
Possible?
Thanks,
Trygve
- Have target A's script write a .h file that contains only "#define
MY_VAR <value>" into a known place, usually $DERIVED_SOURCES_DIR.
- Add "#include $(DERIVED_SOURCES_DIR)/MyVar.h" to the Info.plist
file. This means you have to edit as text from then on; the plist
editor won't work with C constructs.
- Alter the key/value pair in the plist to be <key>MyKey</
key><string>MY_VAR</string>
- Turn on Preprocessing for the Info.plist. Be sure to add -
traditional-cpp to the Other Plist Preprocessor Flags.
That's the general approach.
Chris
_______________________________________________
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