You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Daniel Hoppe <ho...@sitewaerts.de> on 2001/04/01 12:41:24 UTC

Copy files up one folder

Hi,

I guess what I'm trying to do must be quite standard, but I did not figure
out how to do it yet...

In my project I have lot's of configuration files, deployment descriptors
etc. which contain deployment specific tokens. I keep these files in a
sub-folder called ant-templates on different places in the source tree, e.g.

-de
   -sitewaerts
     -futuna
       -ejb
	   -entity
	     -ant-templates
			ejb-jar.xml
			weblogic-ejb-jar.xml
			...
	   -session
	     -ant-templates
			ejb-jar.xml
			weblogic-ejb-jar.xml
			...
	   -gui
	     -ant-templates
			client-props.xml

When building the project, I want to copy all xml files from the
ant-templates folders to the next higher folder in the source tree and
replace the tokens. I think that something like this snippet should work,
but I don't know how to set a 'todir' which is relative to each of the
occurrences found.

  <filter filtersfile="deployment.properties" />
  <copy todir="???" filtering="true" overwrite="true"
preservelastmodified="true">
    <fileset dir="src" >
	<include name="**/ant-templates/*.xml" />
    </fileset>
  </copy>


My first thought, todir=".." did of course not work, as the todir is
relative to the basedir. 

Thanks for any help!

Daniel