0

CruiseControl.net ccnet.configファイルからNANT name.buildファイルにパラメーター(例:URL)を渡す例を教えてもらえますか?

以下は私が試したものです(しかし成功しませんでした)

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

2 に答える 2

2

CCNet Web サイトのシナリオの例を見ましたか? 下部のhttp://www.cruisecontrolnet.org/projects/ccnet/wiki/Step_2_Build_on_Check-in は、サンプル全体で使用される NAnt ビルド スクリプトです。

于 2012-10-16T17:02:25.437 に答える
1

nantビルドファイルにターゲットがありません。

エコーなどの関数呼び出しはターゲット内にある必要があり、クルーズコントロールの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>

targetListnNantは、あなたの場合、ccnet.configの要素で言及されているターゲットを実行しますbuild

于 2012-10-16T19:05:01.180 に答える