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.
Using agvtool with Mercurial Hooks to Update XCode Bundle Versions for New Tags
Set Up Apple Generic Versioning
- In XCode, select your top level project
- Get Info
- Ensure the configuration dropdown is set to ‘All Configurations’
- Set the “Versioning System” definition to
Add the Hook to your Repository
Add the following to your projects’ 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
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!