I have an SVN externals folder which contains many folders called *Plugin then within each of these folders there is a modules folder and a binaries folder.
The problem for me is, within my build task I want to copy **/* from modules to a location within my project, as well as any *.plugin.dll from the binaries location to somewhere else in my project.
So here is a dummy example:
- 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
So in this example I would want to basically copy:
- some.plugin.dll
- some.other.plugin.dll
To a given output directory, then from the modules directory I would want to take:
- some-named-folder (and all content)
- another-named-folder (and all content)
- yet-another-named-folder (and all content)
and put all of that in another given output directory.
I was trying to do this:
<copy todir="${dir.projects.dynamic.binaries}">
<fileset basedir="${dir.plugins}/**/binaries">
<include name="*.plugin.dll" />
</fileset>
</copy>
<copy todir="${dir.projects.dynamic.modules}">
<fileset basedir="${dir.plugins}/**/modules">
<include name="**/*" />
</fileset>
</copy>
However I keep getting an error telling me that basedir on fileset cannot contain ** or any other invalid 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.
The problem is that if I was to do this way instead:
<copy todir="${dir.projects.dynamic.binaries}">
<fileset basedir="${dir.plugins}">
<include name="**/binaries/*.plugin.dll" />
</fileset>
</copy>
<copy todir="${dir.projects.dynamic.modules}">
<fileset basedir="${dir.plugins}">
<include name="**/modules/**/*" />
</fileset>
</copy>
However it copies the parent folders, i.e DummyPlugin1/binaries/some.assembly.dll, DummyPlugin2/binaries/some.other.plugin.dll rather than just the dll which I want. Same with the modules…
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.
So is there any way for me to have my cake and eat it here?
basedirhas to be a single directory, but you should be able to accomplish what you want using theflattenoption, which puts all input files into a single output directory (ignoring the paths, basically).After reading your question again: can you try this?