Re: Info.plist preprocessing in single-file tool? [SOLVED]
Re: Info.plist preprocessing in single-file tool? [SOLVED]
- Subject: Re: Info.plist preprocessing in single-file tool? [SOLVED]
- From: Karl Moskowski <email@hidden>
- Date: Fri, 6 Mar 2009 11:26:27 -0500
Thanks to suggestions from the Rainer and Philip, I used something
like this to customize my tool's Info.plist, using only the built-in
defaults command. Note that the man page mentions that a future
version will support only preferences manipulation, not general plist
processing; maybe Xcode will better support Info.plist processing in
tool-type targets by then. (I've filed Radar Bug #6646614 in case
anyone wants to join the fun.)
The general idea is you copy the source Info.plist to the temporary
build directory, modify the copy, and link using the modified version.
This assumes you have mytool-Info.plist in your project's source root,
and your .xcconfig file has settings called CUSTOM_SETTING and
IDENTIFIER_PREFIX.
First, add a Run Script build phase to your target and put it before
the link phase. Use /bin/sh as the shell.
echo Customizing mytool-Info.plist...
PLIST="$CONFIGURATION_TEMP_DIR"/mytool-Info
cp "$SRCROOT/mytool-Info.plist" "$PLIST.plist"
defaults write "$PLIST" CustomSetting $CUSTOM_SETTING
defaults write "$PLIST" CFBundleIdentifier $IDENTIFIER_PREFIX.mytool
defaults write "$PLIST" CFBundleName $IDENTIFIER_PREFIX.mytool
defaults read "$PLIST"
Then go to the target's Build properties and change the Other Linker
Flags so the path in the -sectcreate flag (after __info_plist) is:
"$(PROJECT_TEMP_DIR)/$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME)/
mytool-Info.plist"
You can also delete/unset any Info.plist options in the Packaging
section, since they're ignored for tool-type targets.
----
Karl Moskowski <email@hidden>
Voodoo Ergonomics Inc. <http://voodooergonomics.com/>
_______________________________________________
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