• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Info.plist preprocessing in single-file tool? [SOLVED]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Info.plist preprocessing in single-file tool? [SOLVED]
      • From: Philip Aker <email@hidden>
  • Prev by Date: (gdb) Won't Answer Me in Debugger Console
  • Next by Date: Re: Info.plist preprocessing in single-file tool? [SOLVED]
  • Previous by thread: NSZombieEnabled still allows crash. Was: (gdb) Won't Answer...
  • Next by thread: Re: Info.plist preprocessing in single-file tool? [SOLVED]
  • Index(es):
    • Date
    • Thread