title: Nant fileset basedir with pattern
body: <p>I have an SVN externals folder which contains many folders called <code>*Plugin</code> then within each of these folders there is a <code>modules</code> folder and a <code>binaries</code> folder.</p>
  
  <p>The problem for me is, within my build task I want to copy <code>**/*</code> from modules to a location within my project, as well as any <code>*.plugin.dll</code> from the binaries location to somewhere else in my project.</p>
  
  <p>So here is a dummy example:</p>
  
  <pre><code>- DummyPlugin1
    |- binaries
       |- some.assembly.dll
       |- some.plugin.dll
    |- modules
       |- some-named-folder
          |- some-sub-folder
             |- some.content.xml
          |- some-other-sub-folder
             |- yet-another-folder
                |- some.more.content.jpg
  - DummyPlugin2
    |- binaries
       |- some.other.plugin.dll
    |- modules
       |- another-named-folder
          |- content.xml
          |- image.jpg
       |- yet-another-named-folder
          |- some-web-page.html
  </code></pre>
  
  <p>So in this example I would want to basically copy:</p>
  
  <ul>
  <li>some.plugin.dll</li>
  <li>some.other.plugin.dll</li>
  </ul>
  
  <p>To a given output directory, then from the modules directory I would want to take:</p>
  
  <ul>
  <li>some-named-folder (and all content)</li>
  <li>another-named-folder (and all content)</li>
  <li>yet-another-named-folder (and all content)</li>
  </ul>
  
  <p>and put all of that in another given output directory.</p>
  
  <p>I was trying to do this:</p>
  
  <pre><code>&lt;copy todir="${dir.projects.dynamic.binaries}"&gt;
      &lt;fileset basedir="${dir.plugins}/**/binaries"&gt;
          &lt;include name="*.plugin.dll" /&gt;
      &lt;/fileset&gt;
  &lt;/copy&gt;
  &lt;copy todir="${dir.projects.dynamic.modules}"&gt;
      &lt;fileset basedir="${dir.plugins}/**/modules"&gt;
          &lt;include name="**/*" /&gt;
      &lt;/fileset&gt;
  &lt;/copy&gt;
  </code></pre>
  
  <p>However I keep getting an error telling me that basedir on fileset cannot contain ** or any other <em>invalid</em> symbols. The documentation seems a bit vague as to if you can or cannot use patterns in your fileset basedir or not, however I am assuming after this error that I cannot.</p>
  
  <p>The problem is that if I was to do this way instead:</p>
  
  <pre><code>&lt;copy todir="${dir.projects.dynamic.binaries}"&gt;
      &lt;fileset basedir="${dir.plugins}"&gt;
          &lt;include name="**/binaries/*.plugin.dll" /&gt;
      &lt;/fileset&gt;
  &lt;/copy&gt;
  &lt;copy todir="${dir.projects.dynamic.modules}"&gt;
      &lt;fileset basedir="${dir.plugins}"&gt;
          &lt;include name="**/modules/**/*" /&gt;
      &lt;/fileset&gt;
  &lt;/copy&gt;
  </code></pre>
  
  <p>However it copies the parent folders, i.e <code>DummyPlugin1/binaries/some.assembly.dll</code>, <code>DummyPlugin2/binaries/some.other.plugin.dll</code> rather than just the dll which I want. Same with the modules...</p>
  
  <p>I know I could change the basedir to include DummyPlugin1/binaries, DummyPlugin2/binaries but I do not know how many folders will be in there or what their names will be without constantly altering the build script, so I would rather keep it dynamic so it will just pull out whatever plugins and modules are in there for me, rather than me having to make a copy for EACH plugin folder that may or may not be in there.</p>
  
  <p>So is there any way for me to have my cake and eat it here?</p>