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:
is altered to:
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