CruiseControl.NET在项目配置中使用项目名称

时间:2014-01-09 23:12:46

标签: cruisecontrol.net cruisecontrol ccnet-config

有没有办法在CruiseControl.NET的项目配置中使用项目名称? 我根据其他不起作用的帖子尝试${project.name}

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <cb:define BuildArtifactsMainDir="D:\CCNet\BuildArtifacts\"/>
  <project name="MyProject">
    <artifactDirectory>$(BuildArtifactsMainDir)${project.name}</artifactDirectory>
    <tasks>
      <exec>
        <executable>C:\Windows\System32\robocopy.exe</executable>
        <buildArgs>D:\${project.name} F:\${project.name}</buildArgs>
        <buildTimeoutSeconds>600</buildTimeoutSeconds>
        <successExitCodes>0,1,3,4,8,16</successExitCodes>
      </exec>
    </tasks>

1 个答案:

答案 0 :(得分:1)

我认为项目名称没有参数。您可以改为使用scopes

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">
  <cb:define BuildArtifactsMainDir="D:\CCNet\BuildArtifacts\"/>
  <cb:scope ProjectName="MyProject">
    <project name="$(ProjectName)">
      <artifactDirectory>$(BuildArtifactsMainDir)$(ProjectName)</artifactDirectory>
      ...
    </project>
  </cb:scope>