Re: Add variable from script during build
Re: Add variable from script during build
- Subject: Re: Add variable from script during build
- From: Andrew Pontious <email@hidden>
- Date: Mon, 23 Mar 2009 18:07:24 -0700
On Mar 20, 2009, at 10:51 PM, Trygve Inda wrote:
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.
When do I turn on these settings? There doesn't seem to be anything
in the
File Types Preferences that will do this.
It's under the Packaging node of the build settings for your target.
-- Andrew
_______________________________________________
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