[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

C# AssemblyInfo integration

From: Yves Goergen <nospam.list_at_unclassified.de>
Date: Thu, 27 Aug 2009 08:48:58 +0200 (CEST)

I would like to use the SVN revision of a source code as the 4th part of
the version number in the AssemblyInfo.cs file in a C# .NET project.
Unfortunately the keyword substitution that SVN provides cannot easily be
used for that task. All I need is the plain number with no junk around it.
And if I create a build task that alters the file before a build, it will
be marked as changed and wants to be commited after each build.

My idea is another one: Add transparent integration of that feature into
the SVN system and control it through an SVN file property. It could work
like this: Set the property like "csharp-assembly-revision" to the
AssemblyInfo.cs file and at each update, the client gets a new version of
that file with the revision number updated in a line like this:

[assembly: AssemblyVersion("")]

is altered to:

[assembly: AssemblyVersion("")]

with 678 being the SVN revision that the file was checked out from.

There should be no need for any keywords whatsoever. The revision number
should be replaced directly in this line. Also the file should be fetched
from the client (and possibly merged if any other assembly attribute was
changed locally) and not be marked as changed by this. So the file should
always contain the current revision number but never be included in a
commit only because of this change.

Now my question is: How can this be done? Is it a good idea at all? At
least it would be an easy one. Set the keyword and you're done - no more
hacks and loads of build tasks that need to be configured for each project
anew. Can SVN be customised or extended at some point to add this feature
or would that need to go into the server core? Does it need any special
client support? I'm using AnkhSVN at the moment.


To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-27 08:55:08 CEST

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.