私は既存のNAntビルドスクリプトをリファクタリングして、ほぼすべてのプロジェクトでそれらを使用でき、 CruiseControl .NET。私はターゲットが正しく設定されていない問題を見つけました。ビルド例外CCNET 1.6からNAnt 0.91を呼び出すときに、 "ターゲット"がこのプロジェクトに存在しません "
次のように私はNAntのに私のコールを定義している:私のエラーメッセージが
ターゲットフレームワークを述べ
<target name="clean"> <exec program="${MSBuildPath}"> <arg line='"${SolutionFile}"' /> <arg line="/property:Configuration=${SolutionConfiguration}" /> <arg value="/target:Clean" /> <arg value="/verbosity:normal" /> <arg value="/nologo" /> <arg line='/logger:"${CcnetMsbuildLoggerPath}"' if="${file::exists('${CcnetMsbuildLoggerPath}')}"/> </exec> <delete> <fileset basedir="."> <include name="bin\**\*" /> <include name="TestResults\**\*" /> </fileset> </delete> </target> <target name="build" depends="clean"> <delete> <fileset basedir="${LocalDeployRoot}"> <include name="**\*"/> </fileset> </delete> <exec program="${MSBuildPath}"> <arg line='"${SolutionFile}"' /> <!--arg line='/property:Configuration="${SolutionConfiguration}"' /--> <arg line='/property:OutputPath="${LocalDeployRoot}"' /> <!--arg line='/property:Platform="${SolutionPlatform}"' /--> <arg value="/target:Rebuild" /> <arg value="/verbosity:normal" /> <arg value="/nologo" /> <arg line='/logger:"${CcnetMsbuildLoggerPath}"' if="${file::exists('${CcnetMsbuildLoggerPath}')}"/> </exec> </target>
<tasks> <nant> <executable>$(NAntExecutablePath)</executable> <buildFile>D:\ci\default.build.xml</buildFile> <!--baseDirectory></baseDirectory--> <buildArgs> -D:SolutionFile="$(Batch_WorkingFolderTrunk)\MySolution.sln" -D:LocalDeployRoot=D:\ci\deploy\MyProject </buildArgs> <targetList> <target>build</target> </targetList> </nant> </tasks>
を、私のビルドファイルが必要な必要なタスクがあります。 Microsoft .NET Framework 4.0ターゲット:
ビルド[echo] Starting the build script
BUILD FAILED
ターゲット '' このプロジェクトには存在しません。
合計時間:0.1秒。
私は、コマンドラインを介して成功しNAntのスクリプトを実行することができます
Dを:\ CI>ナント-0.91 \ binに\ nant.exe /f:default.build.xml構築-D:SolutionFile = "D:\ CIは\ code \ MyProjectと\ MySolution.sln" -D:LocalDeployRoot = D:\ CI \展開\ MyProjectの