CruiseControl.NET:在ccnet.config文件中使用$(CCNetLabel) [英] CruiseControl.NET: using $(CCNetLabel ) inside ccnet.config file

查看:118
本文介绍了CruiseControl.NET:在ccnet.config文件中使用$(CCNetLabel)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当调用诸如MSBuild的外部进程时,巡航控制会设置环境变量。值之一是CCNetLabel。它保留当前项目标签的值。我想在ccnet config本身中使用相同的值,但是当我尝试ccnet config时出现问题。我收到以下错误:

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)

.....

----------

我实际上想将CCNetLabel附加到另一个变量,因此我需要访问该属性在ccnet.config中。

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?

推荐答案

我们也有必要这样做,发现我们可以使用替代动态价值ues (在CruiseControl.NET 1.5中引入),可以从ccnet.config中访问 CCNetLabel

We had a need to do this too, and found that we could use Replacement Dynamic Values, introduced in CruiseControl.NET 1.5, to access the CCNetLabel from within ccnet.config.

例如,此代码段中的 dynamicValues 块:

For example, the dynamicValues block in this snippet:

  <buildpublisher>
    <sourceDir>C:\ccnet_projects\Installer\bin\x86\Release</sourceDir>
    <dynamicValues>
      <replacementValue property="publishDir">
        <format>C:\builds\installers\{0}\x86</format>
        <parameters>
          <namedValue name="$CCNetLabel" value="Default" />
        </parameters>
      </replacementValue>
    </dynamicValues>
    <useLabelSubDirectory>false</useLabelSubDirectory>
  </buildpublisher>

生成包含 CCNetLabel publishDir 路径动态价值:

Produces a publishDir path containing the CCNetLabel value on the fly:

  <buildpublisher>
    <sourceDir>C:\ccnet_projects\Installer\bin\x86\Release</sourceDir>
    <publishDir>C:\builds\installers\1.0.2.120\x86</publishDir>
    <useLabelSubDirectory>false</useLabelSubDirectory>
  </buildpublisher>      

(请注意,对于此特定示例, useLabelSubDirectory 设置为false避免将 CCNetLabel 附加到 publishDir 路径。)

(Note that for this particular example, useLabelSubDirectory is set to false to avoid appending the CCNetLabel to the publishDir path.)

这篇关于CruiseControl.NET:在ccnet.config文件中使用$(CCNetLabel)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆