title: Check if environment variable has been set in Ant script
body: <p>What is the most efficient way of checking if an environment variable has been set prior to executing the rest of an Ant script?</p>
  
  <p>Let's say my Ant script requires the environment variable "FOO" to be set.  I got the following to work, but I was wondering whether there was a less convulated way of achieving the same result:</p>
  
  <pre><code>&lt;property environment="env"/&gt;
  &lt;property name="env.FOO" value=""/&gt;
  
  &lt;target name="my-target"&gt;
      &lt;condition property="foo.found"&gt;
          &lt;not&gt;
              &lt;equals arg1="${env.FOO}" arg2=""/&gt;
          &lt;/not&gt;
      &lt;/condition&gt;
      &lt;fail unless="foo.found" message="FOO not set."/&gt;
      &lt;!-- do stuff here that uses the FOO environment variable --&gt;
  &lt;/target&gt;
  </code></pre>