Using only Ant, I want to copy subdirectories of some top-level directories, but the names of top-level directories can change, so I need Ant to programmatically determine which directories will be copied.
In other words, given the sample directory structure below, copy the contents of each directory ./<projectX>/binto ./bin.
bin
project1
\
\
\
\
\
\
\
\
\
\
project2
\
\
\
\
\
\
\
project3
\
\
\
\
\
\
\
\
And the end result will be a bin directory, which looks like this:
bin
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
\
I tried
<copy todir="${basedir}/bin">
<fileset dir="${basedir}">
<include name="**/bin/*"/>
<exclude name="bin"/>
</fileset>
</copy>
but includes directories projectX/binunder the top-level bin directory.
source
share