Re: Expanding build settings in a secondary .plist
Re: Expanding build settings in a secondary .plist
- Subject: Re: Expanding build settings in a secondary .plist
- From: Rainer Brockerhoff <email@hidden>
- Date: Sat, 23 Feb 2008 10:03:44 -0300
At 23:30 -0700 22/02/08, Chris Espinosa wrote:
>On Feb 22, 2008, at 2:42 PM, Rainer Brockerhoff wrote:
>>I had hopes of just being able to put an extra line into my script, like:
>> /path/to/info-plist-utility "$SOURCE_ROOT/Special.plist" -expandbuildsettings -o "$UNLOCALIZED_RESOURCES_FOLDER_PATH/Special.plist"
>>but since there's no real tool, I don't know what to do.
>
>This is not easy to do. You could always set up a bogus target just for the purposes of preprocessing the Info.plist, then have a Run Script build phase copy it over, but that's a hack.
As I supposed, that'd then be my easiest way out... I already have a target that builds a postprocessing tool, so I'll change that to do that .plist. I agree it's not elegant.
>The Info.plist file is, as you realize, a build setting that is specially processed by the build system, not general-purpose files to be compiled like sources or resources. I don't know of a mechanism to access Xcode's internal plist processing stages other than through building a target's Info.plist.
In /Developer/Library/PrivateFrameworks/DevToolsCore.framework/Versions/A/Resources/Built-in compilers.pbcompspec, there's a section that describes some details:
>This tool performs various somewhat specific operations on Info.plist files. Specifically, it reads the input file, parses it as a property list, and optionally expands property macros in all values in the plist. All keys in a predefined set are checked to make sure the corresponding value isn't empty; if it is equal to the empty string, the key-value pair is removed (for example, it is not allowed to have a CFBundleExecutableName key with an empty value, so if that expands to empty it should just be removed). The expansion dictionaries are passed out-of-band, in the command's internal 'custom tool info object' property.
I suppose it wouldn't be overly hard to write a separate tool that performs this expansion, and I may do so once I find time... would you say it's reasonable to file an enhancement request for including such a tool into Xcode, later? (I'd send the source in.)
This would be for expanding .plist files that are not _the_ Info.plist.
At 03:48 -0800 23/02/08, Philip Aker wrote:
>I think you could use the 'defaults' tool to write the values to the secondary plist after it is copied to the proper location. This would be in the same build script phase. When accessing a property list file using a full path for use with 'defaults', don't include the .plist extension.
Interesting idea, thanks; I've looked briefly at that, but it can't do what I want without some pre-massaging of the values. For now I'll go with Chris' 'hack'.
--
Rainer Brockerhoff <email@hidden>
Belo Horizonte, Brazil
"In the affairs of others even fools are wise
In their own business even sages err."
Weblog: http://www.brockerhoff.net/bb/viewtopic.php
_______________________________________________
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