如何用CruiseControl.Net来进行持续化集成(3)


http://www.cruisecontrolnet.org/projects/ccnet/wiki/Configuration_Preprocessor#Preparing-to-Use-the-Preprocessor


Preprocessor Elements

The configuration preprocessor has several elements that control its processing of your configuration.
  • The <define> element is used to define constants to be expanded later.
  • The <include> element is used to include the contents of another file.
  • The <scope> element is used to encapsulate sections that change the value of an existing constant.

Expanding Preprocessor Constant Values

Once defined, preprocessor constants can be expanded in two ways: as text references or as XML references.

Text References

References of the form "$(const_name)" which are found in attribute values or text nodes will be expanded such that the text value replaces the reference. If no constant exists with the given name and there exists a windows environment variable with the same name, that environment variable's value will be used.

Examples

Use in an attribute:

1<cb:define foo="bar"/> 2<somexml attr1="$(foo)"/>

expands to:
1<somexml attr1="bar"/>

Use as text of an element:
1<cb:define foo="bar"/>
2<somexml>$(foo)</somexml>

expands to:
1<somexml>bar</somexml>


你可能感兴趣的:(.net)