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

Re: C# AssemblyInfo integration

From: Ryan Schmidt <subversion-2009b_at_ryandesign.com>
Date: Thu, 27 Aug 2009 02:13:04 -0500

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
> 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("1.2.3.4")]
>
> is altered to:
>
> [assembly: AssemblyVersion("1.2.3.678")]
>
> 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.

The usual answer to this question is: that's not the way to do it;
this is:

http://subversion.tigris.org/faq.html#version-value-in-source

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2387794

To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-27 09:14:05 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.