• 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: SVN revision number in CFBundleVersion
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: SVN revision number in CFBundleVersion


  • Subject: Re: SVN revision number in CFBundleVersion
  • From: Jean-Francois Roy <email@hidden>
  • Date: Wed, 03 Aug 2005 02:01:38 -0400

Parts of following script will replace any ${VARIABLE} token in a product's Info.plist file with the corresponding VARIABLE environment variable. So, in your Info.plist file, you would set CFBundleVersion to ${REVISION}, and the script below will replace it with the current revision.

Please note that it is quite possible to have an old revision number if you do not update your repository. For example, if you make a commit from revision 25 to 26, and do not perform an update on the repository before running this script, you will get 25 in your Info.plist as the CFBundleVersion. This is simply how Subversion works.

And now, the script. Please note the rather ugly way to find Subversion. This certainly could be improved, but you'll get the idea.

# START OF SCRIPT

SUBVERSION=`defaults read com.apple.Xcode XCSubversionToolPath 2>/dev/ null`
if [ "${?}" != 0 ] ; then
SUBVERSION="/usr/local/subversion/bin/svn"
fi


export REVISION=`$SUBVERSION info | sed -n '/Revision/s/Revision: //p'`

rm "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"
cp "${INFOPLIST_FILE}" "${TARGET_BUILD_DIR}/${INFOPLIST_PATH}"

perl -i -pe 's/\$\{([^}]*)\}/$ENV{$1}/g' "${TARGET_BUILD_DIR}/$ {INFOPLIST_PATH}"

# END OF SCRIPT


On Aug 1, 2005, at 17:08, Giovanni Donelli wrote:

Dear Folks,
does anybody know a clever way to automatically insert the SVN revision number in CFBundleVersion into the info.plist file?


should I write a script to do that? are there special tools to archive that?

thank you!

Giovanni
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40macstorm.org


This email sent to email@hidden



Jean-Francois Roy

--
Co-Founder of MacStorm
Programmer at MacStorm

http://www.macstorm.org
email@hidden

http://www.macstorm.org/bahamut/Jean-Francois.gpgkey

Attachment: PGP.sig
Description: This is a digitally signed message part

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: SVN revision number in CFBundleVersion
      • From: Aaron Burghardt <email@hidden>
References: 
 >SVN revision number in CFBundleVersion (From: Giovanni Donelli <email@hidden>)

  • Prev by Date: Re: NSOutlineView and the trash can, take 2
  • Next by Date: Mixing C++ with Objective C
  • Previous by thread: Re: SVN revision number in CFBundleVersion
  • Next by thread: Re: SVN revision number in CFBundleVersion
  • Index(es):
    • Date
    • Thread