On Tue, 2006-06-06 at 11:41 +0200, [EMAIL PROTECTED] wrote:
> I want to distribute the build.xml file with an application and therefore
> not include any paths to software the application depends on. Ideally I
> would want to take this from an environment variable and show an error
> message if the environment variable is not set.
> 
> Currently I set a property like this:
>   <property name="sw.home" location="${env.THE_VARIABLE}" />
> and later use sw.home wherever needed.
> 
> I cannot figure out how to best provide a default here or even better, abort
> with a descriptive error message if the environment variable is not set.

<property environment="env"/>
<fail message="MY_VAR not set. See README.txt" unless="env.MY_VAR"/>

Cheers, Ben

Ben Stringer ===== [EMAIL PROTECTED]
==================================



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to