[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: Tue, 01 Sep 2009 20:24:06 +0200

On 01.09.2009 09:38 CE(S)T, si wrote:
>> How can I set a property in such an MSBuild project? Can the value of a
>> property come from an external tool that e.g. runs across the working
>> copy to determine the SVN revision number?
>
> Absolutely, in our case CruiseControl.NET is passing $(CCNetLabel) to
> CIBuildNumber, so we do something like:
>
> msbuild.exe Framework.sln /p:CIBuildNumber=$(CCNetLabel) ...

Sorry, I'm not using Cruise Control (don't even know what that is). I'm
using Visual Studio and I'm not calling some msbuild.exe on my own, but
press the "build" button from the VS GUI (or use the appropriate hotkey).

Btw, I have now written a small tool that can do exactly what I need:
Parse the SVN working copy, determine the highest revision number,
optionally stop on any modifications and then patch and restore the file
AssemblyInfo.cs. All you need to do is create the two pre- and
post-build tasks in the project settings and modify the csproj file to
add the (let me look it up)
<UseHostCompilerIfAvailable>false</UseHostCompilerIfAvailable> line.
Here's why: http://stackoverflow.com/questions/541546

>> Does this task affect the file being compiled or will I again have to
>> set that "don't use host compiler" flag on the csproj file?
>
> If you make the change in the BeforeBuild target, it updates the file
> before compilation, which is normally always what you want, but if
> not, use AfterBuild target.

What I change a source file in a Visual Studio pre-build event, the
change is not regarded by the build. Instead the previous version of the
file is built.

-- 
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=2389865
To unsubscribe from this discussion, e-mail: [users-unsubscribe_at_subversion.tigris.org].
Received on 2009-09-01 20:25:22 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.