The file used with the <version> task is a plain text
file with only the version number in it.

For example, create a new text file and rename it to:
'build.number' 

Open the file with a text editor and add your version
number:
1.0.0.0

The <version> task will read the version number, apply
its incrementing algorithm, copy the new version
number into a property whose name you specify with the
'prefix' attrib (default is 'sys', so the property
name will be 'sys.version'), then save the new version
number back into the file for the next build. You can
then use the <asminfo> task to generate
AssemblyInfo.xx file, specifying the version with:
<asminfo ...>
  ...
  <attributes>
    <attribute type="AssemblyVersionAttribute"
value="${sys.version}" />
    ...
  </attributes>
</asminfo>

In order for all of my projects in the solution to use
the same AssemblyVersion.xx file, I create this file
at the solution root, then add it to my projects as a
link . Web projects, however, won't allow you to add
files as a link. In this case, I simply use a <copy>
task to put it with my Web projects.


To: "Troy Laurin" <[EMAIL PROTECTED]>,
        [EMAIL PROTECTED]
Subject: RE: [Nant-users] Auto incrementing build
numbers
From: [EMAIL PROTECTED]
Date: Mon, 18 Oct 2004 16:17:51 -0500

This is a multipart message in MIME format.
--=_alternative 0075247886256F31_=
Content-Type: text/plain; charset="US-ASCII"

Do you know of a better example? What is the format of
the text file? 
There are no examples in the docs. 

Christian Duhard
[EMAIL PROTECTED]
Convergys Corporation
(204) 833-8644





"Troy Laurin" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED]
08/04/2004 10:14 PM
 
        To:     "Tim Mavers" <[EMAIL PROTECTED]>, 
<[EMAIL PROTECTED]>
        cc: 
        Subject:        RE: [Nant-users] Auto
incrementing build 
numbers


 NAnt-contrib has a <version> task which does what you
are after:

http://nantcontrib.sourceforge.net/help/tasks/version.html



-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
Nant-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to