I am updating the code on a daily basis and commit all changes in each case so there is the new code available on server all the time.
What I would like to simplify is build automation and version control. Currently I build a project and edit it's name version (Project Name vx.x.x) each time the the boss needs it which is not time effective.
Does anyone know what's the best way to keep the newest software version with corresponding version number available all the time?
For development I use VS 2008 and for subversioning Tortoise SVN. I tried to use nant for buid automation but don't have any experience with it and don't know how could I edit version number in VS or pass the Tortoise's revison number to nant so it could generate project name with release number.
Thanks!
First, don't try to use SVN keyword substitution to do this. If you put the $rev$ keyword inside a file and enable keyword substitution with the svn:keywords property, you will not get what you want. You will get the last revision that affected the file that contains the keyword, instead of the last revision that affected any part of the project.
The correct way to do this is to use the output of the svnversion command. You will probably need to write a little script that invokes this command, captures the output and then uses the revision number to update a project file or source code file somewhere.
If you can rely on TortoiseSVN being installed, an easier alternative is to use the SubWCRev.exe utility like this:
SubWCRev.exe . VersionInfo.template VersionInfo.cs
where VersionInfo.template would look like this for a C# project:
using System.Reflection;
[assembly: AssemblyVersion("2.0.0.$WCREV$")]
[assembly: AssemblyFileVersion("2.0.0.$WCREV$")]
Caveat: windows version numbers consist of 4 numbers, each limited to 16 bit. Subversion revision numbers can easily become bigger than that.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With