Question

Does anyboy know how to pass the LastChangeNumber parameter into MSBuild?

I'm trying to use this:

<Exec Condition=" '$(LastChangeNumber)' != '' " Command=">\\server\destination\subversion_revision.txt echo subversion $(LastChangeNumber)" />

Which successfully ignores the condition if I leave out the LastChangeNumber parameter from the MSBuild, and succeeds if I pass in a bunk parameter like /p:LastChangeNumber=foo. However, when I try this:

  <msbuild>
    <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
    <projectFile>MySolution.sln</projectFile>
    <buildArgs>/noconsolelogger /p:Configuration=Debug /p:LastChangeNumber=$(LastChangeNumber) /v:diag</buildArgs>
    <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
  </msbuild>

I get an error in my CrusieControl.NET server log:

ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException: Reference to unknown symbol LastChangeNumber

Was it helpful?

Solution

Well, I found ONE way to do it:

<Exec Command=">$(DeployDir)label.txt echo subversion $(CCNetLabel)" />

With a custom labeler:

<labeller type="assemblyVersionLabeller">
  <major>2</major>
  <minor>0</minor>
</labeller>
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top