java - Ant target to move directories out of another directory -
how move directories 1 directory using ant task?
my directory structure like:
my/directory/root |-dir1/one/same/lib |-dir2/two/same/lib |-dir3/three/same/lib |-dir4/four/same/lib
and move , scale folders "same/lib" , move "my/directory/root"
(finally: my/directory/root/same/lib)
something should work:
<target name="movedirs"> <mkdir dir="my/directory/root/merged" failonerror="false"> <move todir="my/directory/root/merged"> <fileset dir="my/directory/root"> <include name="dir*/*"/> </fileset> <mapper> <regexpmapper from="^(.*?)dir[0-9]+.(.*)$" to="\1\2"/> </mapper> </move> </target>
reference:
Comments
Post a Comment