title: How to exclude a directory from ant fileset, based on directories contents
body: <p>How can I create an ant fileset which excludes certain directories based on the contents of the directory?</p>
  
  <p>I use ant to create a distribution jar which has each localization in separate directories, some of which are incomplete and should not be released.</p>
  
  <p>I would like to add something to the directory (for example a file named <code>incomplete.flag</code>) so that ant excludes the directory. Then I can delete the file when translation is complete, and include it in the build without modifying build.xml.</p>
  
  <p>Given this directory structure:</p>
  
  <pre><code>proj
  + locale
    + de-DE
    + en-US
    + fr-FR
  </code></pre>
  
  <p>This fileset excludes all <code>incompelte.flag</code> files, but how can I exclude the entire directories that <em>contain</em> them?</p>
  
  <pre><code>  &lt;fileset dir="${basedir}"&gt;
      &lt;include name="locale/"/&gt;
      &lt;exclude name="locale/*/incomplete.flag"&gt;
    &lt;/fileset&gt;
  </code></pre>
  
  <p>I can write an ant task if need be, but I'm hoping the <code>fileset</code> can handle this use case.</p>