TfsVersion versioning suggestion

Jan 13, 2012 at 11:57 AM

It would be very nice if it would support  “$(current).$(current).$(increment).0″ versioning format or format tokens. Using DateTime for versioning is really weird and just a last resort for troubles.

Coordinator
Jan 14, 2012 at 3:46 PM

Hi Olcay!

You don't have to use the date/time features of the TfsVersion activity.  I actually use a mixture of both.  Sometimes, I will let the standard build versioning functionality in TFS build handle the versionion.  I could set the Build Version Format process parameter to something like:

 "$(BuildDefinitionName)_1.0.0($Rev:.r)" 

This will auto-increment the final revision number automatically but still allow you to specify the major & minor version staticly.  I then use a regular expression to match on the version portion of the full build number and then use the TfsVersion activity to stamp that version number (instead of generating a new one) on all of the Assembly Info files.  There is actually a walkthrough on how to do this in Chapter 16 of Professional Team Foundation Server 2010 if you want to step through it.

Alternately, you could use the TfsVersion activity to use a static major & minor version number and generate an incremental number for either of the two other version parts as you described.  That's available right out of the box with the latest version of the TfsVersion workflow activity.  Just specify what you want your major and minor version portion to be in the activity's parameter.  You could even bind this to a workflow variable or parameter that you can then use to specify at build definition edit time.