I have the following simple thing to do with Ant but did not fi开发者_JS百科nd how to do that:
move build/xxx/file.ext
to dest/xxxfile.ext
I'm no Ant Guru .
file.ext
is constant in this particular case
Nota : xxx
can take many values so I want to apply to all these values
You need to use a mapper
element to generate the destination file names. This is derived from the Ant mapper
docs:
<move todir="dest">
<fileset dir="build" includes="*/*.ext" />
<mapper type="regexp" from="^([^/]*)/([^/]*)" to="\1\2"/>
</move>
When in doubt, an exec will do the job for you, but it's not always the best way.
Try the move task.
<move file="build/xxx/file.ext" tofile="dest/xxxfile.ext"/>
精彩评论