[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: Yves Goergen <nospam.list_at_unclassified.de>
Date: Fri, 28 Aug 2009 08:11:37 +0200

On 27.08.2009 22:17 CE(S)T, Kenneth Goldman wrote:
> The problem I see with this is that if you ever 'svn export' your source
> to some other person who doesn't have access to the repository, they
> won't be able to compile, because they will have $Revision$ rather
> than a real value.

No, the "$Revision$" is of course not in effective source code as it
would be totally in the way there. It's just in a // comment line so the
compiler won't ever see that information. My script just tries to grab
it from that line and copy the bare number into the active code line so
that it can compile. The repository always has the version number
"x.x.x.0" in that place, so if you won't use the script, you just won't
have the revision number in the code, that's all.

Right now the script throws an error and aborts the build if it cannot
find a revision number, but that could be turned off as well.

But anyway, whenever the file AssemblyInfo.cs is fetched from the repo,
it should always have that keyword expanded, if I understood that right,
so everybody who works offline on a repo dump can use it as well, just
with a maybe outdated revision number in it. But those builds are not
supposed to go to our client anyway.

BTW, my first try was to use something like this:

[assembly:AssemblyVersion("1.0.0." + "$Revision$".Substring(...))]

but the C# compiler expects static or constant values there.

-- 
Yves Goergen "LonelyPixel" <nospam.list_at_unclassified.de>
Visit my web laboratory at http://beta.unclassified.de
------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=1065&dsMessageId=2388127
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-08-28 08:13:15 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.