2

In ant scripts and MS build files you can set properties at the top how do I do this in the CruiseControl file ccnet.config?

IAdapter
  • 62,595
  • 73
  • 179
  • 242
minty
  • 22,235
  • 40
  • 89
  • 106

2 Answers2

9

You can do this with cb:define. For example:

<cb:define myProjectName="Foo"/>

Then to use the defined property:

<project name="$(myProjectName)" queue="Bar"> </project>

More information about cb:define can be found here:

http://confluence.public.thoughtworks.org/display/CCNET/Configuration+Preprocessor

Dustin
  • 388
  • 1
  • 9
  • @Dustin: do cb:define tags need to be at the root of the document or can they occur anywhere? – minty Oct 01 '09 at 19:35
  • 1
    They can be anywhere. However, I believe that they need to occur before the first use of the property that you are defining. – Dustin Oct 01 '09 at 19:37
3

<cb:define /> creates a pre-processor constant, not a property. Pre-processor constants have global scope and may be defined only once. A property would be scoped to the block in which it is created and could be overloaded with the same name in a different block. You can use the <cb:scope> tag to modify the scope of the pre-processor constant and mimic properties, as shown here:

CruiseControl.NET : Configuration Preprocessor

user661037
  • 31
  • 2