Thibaut Barrère wrote:

Well, same approach for me ( http://www.dotnetguru2.org/tbarrere/?p=229&more=1&c=1&tb=1&pb=1 <http://www.dotnetguru2.org/tbarrere/?p=229&more=1&c=1&tb=1&pb=1> ).

I'd be happy to see such a thing added to StringUtils or some other standard package in NAnt... Things I'm thinking about: - support for c++ version (the expression is slightly different in my case but maybe the one provided by Evan already handles this: I'm using @"AssemblyVersion(Attribute)?\(""(?<version>[^""]*)"
- modifying delaysigned to true or false by the same mechanism
- modifying keyfile

The latter are quite useful for signed builds...

Personally, I prefer a more general approach. Specifically, I think that storing the raw information in an XML file is the way to go, and then use that to generate AssemblyInfo.cs and anything else that needs it.

The reason for this is that there are very often places that need the version number but which aren't based on the AssemblyInfo or any other .Net assembly-based version mechanism. For example, I'm currently on a hybrid, multiplatform project which has pieces in C#, Java, and C++, with the latter two being both MS Windows and UNIX/Linux (and not Mono/.Net). There can also be a need to get the information up to the .msi level, and the mechanism may vary depending on what installer tools you're using. If you're maintaining or distributing multiple versions, it's helpful to get that information into the file names, And so on.

The NAntContrib version mechanism is a bit of hack, and doesn't generalize at all. It's much more flexible to just use xmlpeek/xmlpoke, and nearly as simple.

Gary



-------------------------------------------------------
This SF.Net email is sponsored by:
Power Architecture Resource Center: Free content, downloads, discussions,
and more. http://solutions.newsforge.com/ibmarch.tmpl
_______________________________________________
Nant-users mailing list
Nant-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nant-users

Reply via email to