Re: Info.plist preprocessing in single-file tool?
Re: Info.plist preprocessing in single-file tool?
- Subject: Re: Info.plist preprocessing in single-file tool?
- From: Karl Moskowski <email@hidden>
- Date: Wed, 4 Mar 2009 15:53:38 -0500
On 4-Mar-09, at 3:40 PM, Rainer Brockerhoff wrote:
At 12:11 -0800 04/03/09, email@hidden wrote:
From: Karl Moskowski <email@hidden>
Date: Wed, 4 Mar 2009 10:35:45 -0500
Message-ID: <email@hidden
>
I have a single-file tool project which contains a Info.plist. I've
added -sectcreate to other linker flag, and it gets linked into the
executable correctly. Now, I'm trying to change some values at
build-time using an xcconfig file to facilitate branding, as I've
done in the companion Cocoa application. I've tried enabling both
"Expand Build Settings in Info.plist file" and "Preprocess
Info.plist FIle" in the target, and various combinations of the
other settings in the Packaging section, but none seem to work.
So, unless I'm missing something, it looks like this is unsupported
for this type of target. Does anyone know of a good way to manually
preprocess the Info.plist in a Run Shell Script phase and link the
result into the tool?
This seems to come up every year or so. Here's what I use now:
http://sourceforge.net/projects/plistcompiler
(courtesy of Bernard Desgraupes).
I use this to compile .plc files. Here's a sample of such a file:
plist
{
dictionary
{
key "CFBundleDevelopmentRegion" value string "English"
key "CFBundleExecutable" value string MyProgram
key "CFBundleGetInfoString" value string "MyProgram "
MODULE_VERSION " (" CURRENT_PROJECT_VERSION "), Copyright ©2009 by
MySelf"
key "CFBundleIdentifier" value string com.whatever.MyProgram
key "CFBundleInfoDictionaryVersion" value string "6.0"
key "CFBundleShortVersionString" value string MODULE_VERSION " ("
CURRENT_PROJECT_VERSION ")"
key "CFBundleVersion" value string CURRENT_PROJECT_VERSION
}
}
Note that the all-caps words are build settings, without any $ or
whatever. This file apparently has to be in MacOS Roman encoding
(not UTF8). In a build script phase, it's run like this:
/path/to/plcompile -dest "$SOURCE_ROOT" -o Tool-Info.plist
"$SOURCE_ROOT/Tool-Info.plc"
this must run previous to the link phase where you use -sectcreate.
If I understand the command line correctly, it takes a plc file in the
source directory and turns it into an Info.plist also in the source
directory. From a version control perspective, it may be better to
generate the Info.plist somewehre in the build-products directory and
change the target' -sectcreate setting to point to that.
Also, the uppercase items appear to be build settings, so it behaves
like the Expand Build Settings checkbox in the target. If it works
with xcconfig files, I'm sold.
I think I'll give it a try. Thanks.
----
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