CruiseControl.NET: using $(CCNetLabel ) inside ccn

2019-01-21 19:53发布

When calling external processes like MSBuild cruise control sets environment variables. One of values is CCNetLabel. it holds the value of the current projects label. I want to use the same values in ccnet config itself but when I try ccnet config has a problem. I get the following error:

[CCNet Server:ERROR] INTERNAL ERROR: Reference to unknown symbol CCNetLabel
----------
ThoughtWorks.CruiseControl.Core.Config.Preprocessor.EvaluationException: Reference to unknown symbol CCNetLabel
at ThoughtWorks.CruiseControl.Core.Config.Preprocessor.ConfigPreprocessorEnvironment._GetConstantDef(String name)
at ThoughtWorks.CruiseControl.Core.Config.Preprocessor.ConfigPreprocessorEnvironment.eval_text_constant(String name)

.....

----------

I actually want to append the CCNetLabel to another variable so I need to access the property in ccnet.config.

is there a different way to reference these variables?

8条回答
女痞
2楼-- · 2019-01-21 20:46

The following can be used in config file in ccnet version 1.5 < cb:define buildversion="$[$CCNetLabel]" />

查看更多
Lonely孤独者°
3楼-- · 2019-01-21 20:46

if using version 1.5 then you can directly specify $(CCNetLabel) in the msbuild task

 
<msbuild>
 <executable>C:\WINDOWS\Microsoft.NET\Framework\v3.5\MSBuild.exe</executable>
 <workingDirectory>C:\TestApp\WindowsFormsApplication1</workingDirectory>
 <projectFile>WindowsFormsApplication1.sln</projectFile>
 <buildArgs>/p:Configuration=Debug /p:Platform="Any Cpu" /p:AssemblyVersion=$(CCNetLabel) </buildArgs>
 <targets>build</targets>
 <logger>C:\Program Files\CruiseControl.NET\server\ThoughtWorks.CruiseControl.MsBuild.dll</logger>
</msbuild>
   
   

查看更多
登录 后发表回答