Title: Message
It's just an edge condition that needs to be checked.
 
At one point there was discussion of using the ymmdd as part of the build number for NAnt. Later I proposed just using number of days since a particular date and just incrementing that.
 
- Ants
-----Original Message-----
From: Jaroslaw Kowalski [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 16 September, 2003 11:52
To: Anthony LoveFrancisco; 'Daniel Nguyen'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [nant-dev] RE: [Nant-users] How do one update the AssemblyVersion build number?

Yes, but who would want build numbers to be that high?
 
Jarek
----- Original Message -----
Sent: Tuesday, September 16, 2003 8:15 PM
Subject: RE: [nant-dev] RE: [Nant-users] How do one update the AssemblyVersion build number?

Oops, sorry, my bad. I think that 65535 is the upper limit for build number parts which less than Int32.Max.
 
- Ants
-----Original Message-----
From: Jaroslaw Kowalski [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 16 September, 2003 11:05
To: Anthony LoveFrancisco; 'Daniel Nguyen'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [nant-dev] RE: [Nant-users] How do one update the AssemblyVersion build number?

Yes, it seems to be legal: a snapshot of my ILDASM dump:
 
.assembly extern Sooda
{
  .publickeytoken = (36 D3 1D A5 0D 00 DE DD )                         // 6.......
  .ver 1234:1234:1234:11115
}
 
Jarek

----- Original Message -----
Sent: Tuesday, September 16, 2003 8:00 PM
Subject: [nant-dev] RE: [Nant-users] How do one update the AssemblyVersion build number?

But does your AssemblyInfo.cs file compile with a value greater than 255 in one of the build number parts?
 
- Ants
-----Original Message-----
From: Jaroslaw Kowalski [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 16 September, 2003 10:56
To: Anthony LoveFrancisco; 'Daniel Nguyen'; [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject: Re: [Nant-users] How do one update the AssemblyVersion build number?

No problem: I use strings, not characters, then Int32.Parse() them.
 
I've just checked on "0.0.0.11115" and it works.
 
Jarek
----- Original Message -----
Sent: Tuesday, September 16, 2003 7:51 PM
Subject: RE: [Nant-users] How do one update the AssemblyVersion build number?

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