Title: Message
Before I ruffle too many feathers, I asked my question in the previous message for my own edification. I'm trying to grok the NAnt philosophy.
 
[I'm seeing a lot of grey area between where something must be written as a task, versus <exec>, versus just write a <script>. Often, the tasks are just wrappers for an executable which can be called by <exec>. I can see one of the guidelines for tasks is that they are meant to be platform independent. The grey comes in for me with the <solution>, <sql> and <msi> tasks seem to break this because they are very Win32-centric. What more the <servicecontrol> task?]
 
Just trying to figure out when it's worth writing a tasking versus just "shelling out".
 
If I ruffled any feathers, I apologize profusely.
- Ants
-----Original Message-----
From: Anthony LoveFrancisco [mailto:[EMAIL PROTECTED]
Sent: Tuesday, 16 September, 2003 11:02
To: 'Jaroslaw Kowalski'; 'Daniel Nguyen'; '[EMAIL PROTECTED]'; '[EMAIL PROTECTED]'
Subject: RE: [Nant-users] How do one update the AssemblyVersion build number?

I like this suggestion. It's very clean and streamline.
 
I do have a general question to though: I shot down for suggesting using awk or sed to update the AssemblyInfo.cs because it uses an executable outside of the NAnt framework. Why is this any different?
 
- 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