CruiseControl.NET use project name in project config

268 views Asked by At

Is there any way to use the project name in the project config in CruiseControl.NET ? I tried ${project.name} based on other posts which doesn't work.

<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

There are 1 answers

0
Rafał Rutkowski On

I don't think there's a parameter for project name. You can use scopes instead.

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