Domanda

Fa anyboy sapere come passare il parametro LastChangeNumber in MSBuild?

Sto cercando di usare questo:

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

che ignora con successo la condizione se lascio fuori il parametro LastChangeNumber dal MSBuild, e riesce se mi passa in un parametro a castello come /p:LastChangeNumber=foo. Tuttavia, quando provo questo:

  <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>

ottengo un errore nel mio registro del server CrusieControl.NET:

  

ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException:   Il riferimento a simbolo sconosciuto   LastChangeNumber

È stato utile?

Soluzione

Bene, ho trovato un modo per farlo:

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

Con un'etichettatrice personalizzato:

<labeller type="assemblyVersionLabeller">
  <major>2</major>
  <minor>0</minor>
</labeller>
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top