Writing nAnt Tasks

I finally broke down and started writing my own set of nAnt Tasks to control version (revision) numbering and updating the AssemblyInfo.cs files so our deployed assemblies will finally have the real version number embedded in them. I expect there is documentation somewhere on the best way to do this, but I went with the "if all else fails read the documentation" approach.

My first goal was to get my task working without any of the nant framework. I didn't want some subtle issue causing problems on the basic stuff.

Here is the basic premise of the tasks:

  • get the current version
  • increment the revision
  • update the AssemblyVersion pseudo-attribute (i.e. modify the file)

I am specifically excluding the meta tasks of dealing with version control of the AssemblyInfo.cs file as that is better handled by the vss and cvs tasks.

I should note that I am most interested in manipulating the revision part of the complete version number (major.minor.build.revision) as the other parts are determined by the product managers.

Similar to John Lam's approach I am going to store the version information in a separate file so it can be placed under source control as well. Contrary to John's approach the only option the version task will have is whether to increment or not.

1 Comment

Comments have been disabled for this content.