Viraf, What version of Ant are you running? Please, make sure that the environment variable you are trying to 'echo' is really contained in the environment and maybe remove the dot in <property environment="env." /> so that it reads <property environment="env" />
I tested this on Ant 1.4.1, and it works fine. Cheers, Stan -----Original Message----- From: Viraf Bankwalla [mailto:[EMAIL PROTECTED]] Sent: Sunday, January 27, 2002 12:22 AM To: [EMAIL PROTECTED] Subject: Environment Property Hi, How do I test for the existence of an environment variable ? How do I take an action if a the variable is defined ? I assumed that: <property environment="env." /> <property name="isdefined" value="${env.VARNAME}" /> <echo message="isdefined: ${isdefined}" /> would disply isdefined: however it displays isdefined: ${env.VARNAME} If this is not the desired behaviour, the fix lies in ProjectHelper::replaceProperties. fragment = (keys.containsKey(propertyName)) ? (String) keys.get(propertyName) : "${" + propertyName + "}"; Thanks. - viraf __________________________________________________ Do You Yahoo!? Great stuff seeking new owners in Yahoo! Auctions! http://auctions.yahoo.com -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]> -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
