Random Sequence

A simple hook for Mercurial which updates the “Bundle versions string, short” (CFBundleShortVersionString) in your XCode project Info.plist each time you add a new tag.

Sponsored Links:

Using agvtool with Mercurial Hooks to Update XCode Bundle Versions for New Tags

Set Up Apple Generic Versioning

  1. In XCode, select your top level project
  2. Get Info
  3. Ensure the configuration dropdown is set to ‘All Configurations’
  4. Set the “Versioning System” definition to apple-generic

Add the Hook to your Repository

Add the following to your projects’ hgrc (.hg/hgrc)

[hooks]
pretag = cd <path/containing/xcode-project>; agvtool new-marketing-version $HG_TAG; hg commit -m "Updates Short Bundle Version for tag $HG_TAG"

Replace <path/containing/xcode-project> with the path containing your .xcodeproj

Testing

hg tag "1.0b1"

You should see similar output to this:

mbp% hg tag "1.0b1"

Setting CFBundleShortVersionString of project HookTest to: 
    1.0b1.
Updating CFBundleShortVersionString in Info.plist(s)...
Updated CFBundleShortVersionString in "HookTest.xcodeproj/../Info.plist" to 1.0b1

Help & Supprt

There is no help or support available, sorry!

Sponsored Links: