任何人都可以通过示例帮助我将参数(例如:URL)从CruiseControl.net ccnet.config文件传递给NANT name.build文件吗?
以下是我尝试过的(但没有成功)
**CC.net file**
<tasks>
<nant>
<executable>C:\Program Files (x86)\NANT\nant-0.92\bin\nant</executable>
<buildFile>C:\Program Files (x86)\NANT\nant-0.92\RiDM.Build</buildFile>
<targetList>
<target>build</target>
</targetList>
<buildArgs>-D:myProp=C:\build</buildArgs>
</nant>
</tasks>
**.build file**
<?xml version="1.0"?>
<project name="Parameter test File" >
<description>Test parameter passing among Cruise control and NANt files.enter code here </description>
<echo message="This is echo" />
<if test="${property::exists('myProp')}" />
<echo message="URL: ${myProp}" />
<echo message="This is also echo" />
</project>
答案 0 :(得分:2)
答案 1 :(得分:1)
您的nant构建文件缺少目标。
echo之类的函数调用必须在目标内,然后在巡航控制中的buildArgs中指定目标。
请参阅http://nant.sourceforge.net/release/0.91/help/fundamentals/buildfiles.html
修改后的nAnt脚本
<project name="Parameter test File" >
<description>Test parameter passing among Cruise control and NANt files.enter code here</description>
<target name="build">
<echo message="This is echo" />
<if test="${property::exists('myProp')}">
<echo message="URL: ${myProp}" />
<echo message="This is also echo" />
</if>
</target>
</project>
nNant将执行ccnet.config中targetList
元素中提及的目标,在您的情况下build