views:

338

answers:

0

I am trying to clean up my CruiseControl.NET configuration so that the sections are easier to maintain and new projects are easier to create. For instance, I currently have the following:

<cb:define name="project">
 <project name="$(name) ($(milestone)) [$(env)]">
  <category>$(category)</category>
  <workingDirectory>$(dir)\$(name)\$(milestone)\$(env)\source</workingDirectory>
  <artifactDirectory>$(dir)\$(name)\$(milestone)\$(env)\artifacts</artifactDirectory>
  <cb:svn trunkUrl="$(url)"/>
  <tasks>
   <cb:nant targetEnv="$(env)"/>
  </tasks>
  <publishers>
   <merge>
    <files>
     <file>TestResult.xml</file>
    </files>
   </merge>
   <xmllogger/>
   <cb:email/>
  </publishers>
 </project>
</cb:define>

<cb:project category="MyCategory" name="ivp" milestone="stable_trunk" env="dev" dir="c:\projects" url="$(ivpBaseUrl)/trunk/source"/>
<cb:project category="MyCategory" name="ivp" milestone="stable_trunk" env="test" dir="c:\projects" url="$(ivpBaseUrl)/trunk/source"/>
<cb:project category="MyCategory" name="ivp" milestone="stable_trunk" env="stage" dir="c:\projects" url="$(ivpBaseUrl)/trunk/source"/>

<cb:project category="MyCategory" name="ivp" milestone="m_printing" env="dev" dir="c:\projects" url="$(ivpBaseUrl)/branches/m_printing"/>
<cb:project category="MyCategory" name="ivp" milestone="m_printing" env="test" dir="c:\projects" url="$(ivpBaseUrl)/branches/m_printing"/>

<cb:project category="MyCategory" name="ivp" milestone="m_editing" env="dev" dir="c:\projects" url="$(ivpBaseUrl)/branches/m_editing"/>
<cb:project category="MyCategory" name="ivp" milestone="m_editing" env="test" dir="c:\projects" url="$(ivpBaseUrl)/branches/m_editing"/>

This works well except that I would like to be able to conditionally add tags based on the "env" setting. For instance, "test" and "stage" parameters would signify that I want a forced build (rather than an automatic build). To do this I would need to add an empty trigger section.

It doesn't appear that CruiseControl.NET natively supports conditional statements. Are there any tricks or hidden features that might allow for limited conditional logic?