【发布时间】:2011-09-15 21:19:46
【问题描述】:
我正在重构我现有的 NAnt 构建脚本,以便能够在几乎任何项目中使用它们,并从 CruiseControl .NET 发送正确的值。不过,我遇到了一个问题,即目标设置不正确。
我对 NAnt 的调用定义如下:
<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>
并且我的构建文件具有所需的必需任务
<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>
我的错误信息状态
目标框架:Microsoft .NET Framework 4.0 指定目标:
构建[echo] Starting the build script构建失败
此项目中不存在目标“”。
总时间:0.1 秒。
有什么想法吗?
我可以通过命令行成功运行NAnt脚本:
D:\ci>nant-0.91\bin\nant.exe /f:default.build.xml build -D:SolutionFile="D:\ci\code\MyProject\MySolution.sln" -D:LocalDeployRoot= D:\ci\deploy\MyProject
【问题讨论】:
标签: continuous-integration cruisecontrol.net nant