2015-02-06 164 views
0

亲爱的无所不知的计算器忍者,我需要你的帮助!是否可以自定义CruiseControl.NET项目的强制构建?

我有一个构建C#的解决方案,并执行一些脚本CruiseControl.NET项目。每次我使用“调试”MSBuild配置进行提交时,它都会生成项目。

我需要的是使CC建立我的项目,“调试2”的配置,当我尽了力的构建,但git的承诺建设时,应保持使用“调试”配置。

是否有可能做出这样的动力配置?如果是,我该怎么做?

回答

0

好吧,我已经在CC文档中找到了条件。

<conditional> 
    <conditions> 
    <buildCondition> 
     <value>ForceBuild</value> 
    </buildCondition> 
    </conditions> 
    <tasks> 
    <!-- Tasks to perform if condition passed --> 
    </tasks> 
    <elseTasks> 
    <!-- Tasks to perform if condition failed --> 
    </elseTasks> 
</conditional> 
0

另一种选择是检查构建脚本中的构建条件。 构建脚本可能是nant,msbuild,batch,.... 这些语言通常会为if,while,...构造比ccnet.config文件本身更多的选项。

这样可以使更多的ccnet.config干净,所有的魔法在构建脚本发生。它使测试更改更容易,而不影响构建服务器。

看看属性被传递给他们:

http://www.cruisecontrolnet.org/projects/ccnet/wiki/Integration_Properties

0

使用CCNET参数;

http://cruisecontrolnet.org/projects/ccnet/wiki/Parameters

例如:

<booleanParameter> 
<name>Configuration</name> 
<true name="Debug2">Yes</true> 
<false name="Debug">No</false> 
<display>Configuration</display> 
<description>Do you want to build Debug 2?</description> 
<default>Debug</default> 
<required>false</required> 
</booleanParameter> 

使用它:

<tasks> 
<nant> 
    <executable>nant.exe</executable> 
    <buildArgs>-D:config=$[Configuration|Debug]</buildArgs> 
... 
</nant> 
</tasks> 

配置被传递到南特的财产。

相关问题