Versioning of AssembliesGordon,
You can use our filterchain support in the <copy> task for this.
One way of achieving this is by using a replacetokens filter.
Your AssemblyInfo template would contain something like this:
[assembly: AssemblyVersion ("@ASSEMBLY_VERSION@")]
and your NAnt script would contain this fragment:
<copy file="AssemblyInfo.cs.in" tofile="AssemblyInfo.cs">
<filterchain>
<replacetokens>
<token key="ASSEMBLY_VERSION" value="${assembly.version}" />
</replacetokens>
</filterchain>
</copy>
Hope this helps,
Gert
From: Woodward, Gordon (RBC Dexia IS)
Sent: Tuesday, May 27, 2008 8:38 AM
To: nant-users@lists.sourceforge.net
Subject: [NAnt-users] Versioning of Assemblies
I'm looking for some assistance in setting up a versioning target in my Nant
build script for our .NET assemblies. I've done a bit of a search on the
internet and on the message archive for this list but have only really come
across examples of automatically incrementing the version number. I've looked
at the <version> and <asminfo> tasks but they don't fit our needs.
Basically I just want to be able to send through a version number to nant as a
property and then get nant to adjust the AssemblyInfo files as necessary with
the supplied version number without affecting anything else in the file. Is
anyone doing anything similar that they wouldn't mind sharing?
I found this blog via a link in a old message which is pretty much what I want
to do but don't know how to added this custom task to Nant (I don't have a
developer background unfortunately).
Thanks,
Gordon
____________________________________
This e-mail may be privileged and/or confidential, and the sender does not
waive any related rights and obligations. Any distribution, use or copying of
this e-mail or the information it contains by other than an intended
recipient(s) is unauthorized. If you received this e-mail in error, please
advise me (by return e-mail or otherwise) immediately and delete this e-mail.
The contents of any attachment to this e-mail may contain software
viruses or other defect which might affect your own computer system once
received or opened. While companies under RBC Dexia Investor Services Trust and
its affiliates take reasonable precautions to minimize that risk, we cannot
accept liability or responsibility for any damage or loss which may occur or be
sustained as a result of a software virus or other defect. You are responsible
for virus checks before opening any attachment.
--------------------------------------------------------------------------------
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
--------------------------------------------------------------------------------
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
NAnt-users mailing list
NAnt-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users