Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to get project version in shell script phase?



Marc Respass wrote:

>I want the disk image name to append the version of the project. Of course,
>I can just modify the script but that's such a drag. I'm hoping there's a
>way to get the value for CFBundleVersion in Info.plist but I can't find it.

If nothing else works, you can script the retrieval of CFBundleVersion
directly from the Info.plist of the built app-bundle you are about to
create a disk-image from.  In some sense, this would be the most
authoritative version-number [1].

The 'defaults' command accepts a domain that can be a pathname without the
".plist" suffix.  Since you have the pathname of your app-bundle, needed in
order to disk-image it, you can get the CFBundleVersion from its Info.plist
with:
  defaults read "$PATH_TO_APP/Contents/Info" CFBundleVersion

See 'man defaults' for more information, especially the section on
Specifying Domains.

[1] WARNING: I'm not sure if 'defaults' will honor a "Version.plist" in
Contents/, so you may have to write some conditional shell script code.

  -- GG


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/xcode-users/email@hidden

This email sent to email@hidden



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.