Xml Configuration For NAnt Scripts November, 2007
NAnt scripts can get cluttered with configuration values. One way to clean this up is to create properties that are used throughout the script. Although, you could take this a step further and store NAnt script configuration values in an Xml file. I like this approach because it creates a clear separation between the script and modifiable parameters. For example lets say we have an Xml configuration file called Build.config that contains paths:
Our NAnt script could then load these paths into parameters in an "init" target. All other targets could then depend on this "init" target.
file="Build.config"
xpath="/buildConfiguration/paths/path[@name = 'SubversionPath']/@value"
property="SubversionPath"/>