Build Management and /Duvall13 Jun 2006 08:51 am
Getting Environment variables in NAnt
NAnt contains an impressive set of functions that can be used to get anything from the current working directory to determining whether a file exists to getting environment variables. The syntax is a bit unusual for a build script and the NAnt documentation is sparse on examples. The example below demonstrates the use of the NAnt Environment functions to get the environment variable values for the working machine.
<property name="ncover.console.exe"
value="${environment::get-variable('NCOVER_HOME')}\NCover.Console.exe"/>
<property name="nunit.console.exe"
value="${environment::get-variable('NUNIT_HOME')}\bin\nunit-console.exe"/>

June 14th, 2006 at 9:27 pm
[…] Test Early ยป Getting Environment variables in NAnt (tags: nant) […]
January 30th, 2008 at 10:28 am
Thanks - this is exactly the information I was looking for (referencing environment variables from within nant).