On Aug 27, 2009, at 01:48, Yves Goergen wrote:
> 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
> 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("220.127.116.11")]
> is altered to:
> [assembly: AssemblyVersion("18.104.22.1688")]
> with 678 being the SVN revision that the file was checked out from.
> There should be no need for any keywords whatsoever. The revision
> should be replaced directly in this line. Also the file should be
> 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
> 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
> hacks and loads of build tasks that need to be configured for each
> anew. Can SVN be customised or extended at some point to add this
> or would that need to go into the server core? Does it need any
> client support? I'm using AnkhSVN at the moment.
The usual answer to this question is: that's not the way to do it;
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-27 09:14:05 CEST