Title: Message
In NewBuild.cs, how do you keep each part of the build number from overflowing the upper limit of 255?
 
- Ants
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Jaroslaw Kowalski
Sent: Tuesday, 16 September, 2003 10:33
To: Daniel Nguyen; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [Nant-users] How do one update the AssemblyVersion build number?

You can use my trick:
 
The technique consists of:
 
1. A plain text file that holds nothing but a version number AA.BB.CC.DD (version.txt)
2. A small C# utility that increments one of the components in the file (NewBuild.exe)
3. A small C# utility that replaces AssemblyVersion(...) in all AssemblyInfo.cs files in your project (ReplaceVersion.exe)
4. A few NAnt targets to automate the above (sample.build)
 
I keep binaries of NewBuild.exe and ReplaceVersion.exe in CVS as they are ultra-small (4KB each). Plus, they are portable because they are CLI executables.
 
You can invoke the targets:
 
nant updateversion
 
which update all AssemblyInfo.cs files according to "version.txt" contents.
 
nant newbuild
 
which will increase the fourth component of "version.txt" and update all AssemblyInfo.cs files
 
nant newrevision
 
which will increase the third and fourth component of "version.txt" and update all AssemblyInfo.cs files
 
nant newminor
 
which will increase the second and fourth component of "version.txt", zero the third one and update all AssemblyInfo.cs files
 
nant newmajor
 
which will increase the first and fourth component of "version.txt", zero the second and third one and update all AssemblyInfo.cs files
 
Jarek
 
P.S. Because I keep my "version.txt" as plain as possible, I am even able to parse individual components from my nant buildfile. I can simply use <foreach> with the delimiter set to a dot and because there's only one line - foreach iterates just one time.
 
----- Original Message -----
Sent: Tuesday, September 16, 2003 6:57 PM
Subject: [Nant-users] How do one update the AssemblyVersion build number?

Greeting,

My apologies in advance if the following questions have been asked before.  But, does anyone know how to increase the AssemblyVersion build number everytime it builds?  Does NAnt has any task to take care of this? 

Example:  [assembly: AssemblyVersion("2003.1.0.0")]

The number I want to increase is the 3rd digit in the AssemblyVersion.  Any help would be greatly appreciated.

Daniel Nguyen
Lanmark Graphics Corporation
[EMAIL PROTECTED]


 

Reply via email to