I am trying to define some values in my ccnet.config file.

I am running version

I added xmlns:cb="urn:ccnet.config.builder" to my main cruisecontrol element.like:

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">

next I defined some defines processor constants:

<cb:define prodbuildtag="" />
<cb:define testbuildtag="">

finally I tried to reference the define values in a tag like so:

<sourcecontrol type="svn">

When I bulid using the script it treats the define $(prodbuildtag) as an empty string and checkes out the code based on the trunkUrl 'https://someserver/svn/myproject/tags/'. I am having trouble getting the Configuration Preprocessor to work; please help.

+1  A: 

I tested the code you posted in 1.5 and it seems to work. If you are including multiple files make sure you have <cruisecontrol xmlns:cb="urn:ccnet.config.builder"> in each file

I think $() syntax resolves environment variables as well.

in trying to get this to work I added <cb:define prodbuildtag="" testbuildtag="" /> as a combined define. When I switch it back as it is posted above it started working. I had had it that way at first so I'm not exactly sure what my first problem was.

I know that this works because we do it all the time. Here is an example of what we have in our ccnet.config file:

<cruisecontrol xmlns:cb="urn:ccnet.config.builder">

  <cb:define svnPath="C:\Program Files\CollabNet Subversion\svn.exe"/>      
  <cb:define svnReposRootUrl="http://someserver/svn"/&gt;

  <!-- cc.net auto-updating config project -->
  <project name="ccnet-config">
      <intervalTrigger seconds="30"/>
    <sourcecontrol type="svn">
      <workingDirectory>C:\Program Files\CruiseControl.NET\server\config</workingDirectory>


It's not clear from your question where the cb:define tag is in relation to where you are using it. I would try putting it as child of the cruisecontrol element. I don't know if it can be a child of anything else... I've never tried.


related questions