ANT select a file based on pattern, move to dest and rename -


I copy the file under all directories starting in the root folder ending with $ $ {env} .xml Trying and striping $ $ {env} by the file name if you find or copy the XML file which is present in the directory. I can not get it to work, please help. (Probably I need a move and mapper to change the name and I somehow

  target name = "main"> 
  • copy todir = "qa-wprelease "& Gt; & gt; fileset dir =" bin-debug "includes =" ** / * .xml "& gt; & lt; or & gt; & lt; filename name =" * _ $ {env} .xml "/ & gt; & lt; filename name =" * .xml "/> gt; & gt; & lt; / fileset & gt; & lt; / copy & gt; & lt; / Goal & gt;

    Check the job manual - & lt; Copy & gt; can take a nested element, which is copied with a paradigm You can change your file name. There are several types of & lt; mapper & gt; , with some of them you can also use javascript to change your file name

    So ... maybe you can do it like this (if it is not tested then it definitely works):

      & copy; todir = "qa-wprelease" includeemptydirs = "False" & gt; fileset dir = "bin-debug" = "** / *. Xml "/> & lt; globmapper =" * _ $ {env} .xml "from" "=" *. Xml "/> & lt; / copy & gt;    

  • Comments