Re: How can I set the CFBundleVersion according to subversion/Versions revision number?
This one-liner will return the current BASE revision of your working copy: svn info | grep Revision | sed s/'Revision: '// We use this snippet in Checkout to set the CFBundleVersion value in the Info.plist at build time. We don't use Xcode to build the app, and there might be a more efficient way to manipulate your Info.plist than this when you're not running a Python interpreter anyways already, but adding a custom script like the one below as a build phase for your target should work (if you're developing on Leopard that is, if I remember correctly, plistlib was not included with the Python distribution that shipped with Tiger, but you could install it): (set shell to: /usr/bin/python, add your Info.plist to the list of input files in the "Run Script Phase" window) # --- begin of script import plistlib import os from sys import argv plistPath = argv[len(argv) - 1] plistDict = plistlib.readPlist(plistPath) currentSVNRevision = os.popen("svn info | grep Revision | sed s/'Revision: '//").read().strip() plistDict['CFBundleVersion'] = currentSVNRevision # working with strings is easy in Python, something like what's below should help with the short version shortVersionString = u'MyApp v.1.0, build number %s' % (currentSVNRevision) plistDict['CFBundleShortVersionString'] = shortVersionString # finally, overwrite the old plist file with the modified dictionary plistlib.writePlist(plistDict, plistPath) # --- end of script Written mostly from memory, so fingers crossed that it actually works. - Dirk On Apr 22, 3:06 pm, Alberto Ganesh Barbati wrote: > I don't have a complete answer, but you may find these links > interesting: > > http://chanson.livejournal.com/125568.htmlhttp://developer.apple.com/DOCUMENTATION/DARWIN/Reference/ManPages/ma... > > Ganesh > > On 8 Apr, 09:31, Gatada wrote: > > > Hi, > > > I am sure this problem has a simple solution: > > > How can I use the subversion/Versions revision number as the > > CFBundleVersion in my Xcode project? > > > Maybe it even is a nice, clean and efficient way to get the > > CFBundleShortVersionString set correctly? > > > Thanks! > > Johan > > > CFBundleVersion: identifies an iteration (released or unreleased) of > > the application. > > CFBundleShortVersionString: [major revisions to the application]. > > [revisions that implement less prominent features].[maintenance > > releases] > > > PS: Hm, seems like my post timed out? This is second attempt. Sorry if > > it shows up twice (with slightly different content). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Versions" group. To post to this group, send email to versions@googlegroups.com To unsubscribe from this group, send email to versions+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/versions?hl=en -~--~~~~--~~--~--~---
Re: How can I set the CFBundleVersion according to subversion/Versions revision number?
I don't have a complete answer, but you may find these links interesting: http://chanson.livejournal.com/125568.html http://developer.apple.com/DOCUMENTATION/DARWIN/Reference/ManPages/man8/agvtool.8.html Ganesh On 8 Apr, 09:31, Gatada wrote: > Hi, > > I am sure this problem has a simple solution: > > How can I use the subversion/Versions revision number as the > CFBundleVersion in my Xcode project? > > Maybe it even is a nice, clean and efficient way to get the > CFBundleShortVersionString set correctly? > > Thanks! > Johan > > CFBundleVersion: identifies an iteration (released or unreleased) of > the application. > CFBundleShortVersionString: [major revisions to the application]. > [revisions that implement less prominent features].[maintenance > releases] > > PS: Hm, seems like my post timed out? This is second attempt. Sorry if > it shows up twice (with slightly different content). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Versions" group. To post to this group, send email to versions@googlegroups.com To unsubscribe from this group, send email to versions+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/versions?hl=en -~--~~~~--~~--~--~---
Re: How can I set the CFBundleVersion according to subversion/Versions revision number?
I assume that you are asking here how to add your current commit revision to the application version? like V1.0 build 3212 after a quick google as I couldnt remember where it came from ;) this is what I found and use http://www.red-sweater.com/blog/23/automatic-build-sub-versioning-in-xcode it works for me and I set the script to only run on release builds. Also make sure the APPLICATION_VERSION var is set in the project not the target build settings as this could then cause issues with the debug and release versions not updating the application version correctly (took a while to work that one out!) HTH Kieren On 08/04/2009, at 3:31 PM, Gatada wrote: > > Hi, > > I am sure this problem has a simple solution: > > How can I use the subversion/Versions revision number as the > CFBundleVersion in my Xcode project? > > Maybe it even is a nice, clean and efficient way to get the > CFBundleShortVersionString set correctly? > > Thanks! > Johan > > CFBundleVersion: identifies an iteration (released or unreleased) of > the application. > CFBundleShortVersionString: [major revisions to the application]. > [revisions that implement less prominent features].[maintenance > releases] > > > PS: Hm, seems like my post timed out? This is second attempt. Sorry if > it shows up twice (with slightly different content). > > > --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Versions" group. To post to this group, send email to versions@googlegroups.com To unsubscribe from this group, send email to versions+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/versions?hl=en -~--~~~~--~~--~--~---
Re: How can I set the CFBundleVersion according to subversion/Versions revision number?
On Apr 8, 2:53 pm, msalmonse wrote: > If you look at the properties tab of the inspector you will see a list > of keywords. These are expanded when a file is fetched but they don't > look particularly nice, I don't think that they would be acceptable in > your plist, in any case it is the revision of the plist. > > /Michael Ok, thanks. Yeah, the end result ($Rev: 345 $) doesn't look good. Johan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Versions" group. To post to this group, send email to versions@googlegroups.com To unsubscribe from this group, send email to versions+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/versions?hl=en -~--~~~~--~~--~--~---
Re: How can I set the CFBundleVersion according to subversion/Versions revision number?
On Apr 8, 9:31 am, Gatada wrote: > Hi, > > I am sure this problem has a simple solution: > > How can I use the subversion/Versions revision number as the > CFBundleVersion in my Xcode project? If you look at the properties tab of the inspector you will see a list of keywords. These are expanded when a file is fetched but they don't look particularly nice, I don't think that they would be acceptable in your plist, in any case it is the revision of the plist. /Michael --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Versions" group. To post to this group, send email to versions@googlegroups.com To unsubscribe from this group, send email to versions+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/versions?hl=en -~--~~~~--~~--~--~---
How can I set the CFBundleVersion according to subversion/Versions revision number?
Hi, I am sure this problem has a simple solution: How can I use the subversion/Versions revision number as the CFBundleVersion in my Xcode project? Maybe it even is a nice, clean and efficient way to get the CFBundleShortVersionString set correctly? Thanks! Johan CFBundleVersion: identifies an iteration (released or unreleased) of the application. CFBundleShortVersionString: [major revisions to the application]. [revisions that implement less prominent features].[maintenance releases] PS: Hm, seems like my post timed out? This is second attempt. Sorry if it shows up twice (with slightly different content). --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "Versions" group. To post to this group, send email to versions@googlegroups.com To unsubscribe from this group, send email to versions+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/versions?hl=en -~--~~~~--~~--~--~---