How about using "src" and "dest" for all of them instead of "srcfile" v.s. "srcdir":
<copy src="file" dest="file" /> <delete src="file" /> <move src="file" dest="file" /> and let the code detect whether "file" is a directory or a regular file and act accordingly? If "includes" and/or "excludes" are specified, then both "src" and "dest" must be directories. If there are no "includes" and/or "exlcudes", and "src" is a directory then "dest" must be a directory. If "src" is a regular file, "dest" can be either a regular file (existing or not) or a directory. +1 on Copydir/Copyfile --> Copy, Deltree/Delete --> Delete, Rename --> Move The new Delete can be backwards compatible if the "file" attribute is set. -j > > > My company's current project requires the class files in the > > same path as > > the sources, so in order to do a 'clean' I needed to remove > > the .class files > > from the source tree. We also have generated .java files, same thing. > > Now we are talking about task functionality here, how about > defining some for the next version Ant. > > I think that all the basic tasks of which we have multiple versions, > should be "consolidated", such that we have 1 copy, 1 delete and 1 > rename/move. This could be done as it is in most OSes. > > So for copy we could have the following possible combinations: > > 1. <copy srcfile="file" destfile="file"/> > 2. <copy srcfile="file" destdir="dir"/> > 3. <copy srcdir="dir" destdir="dir" > includes="includes" excludes="excludes"/> > > 1. Copy the file in srcfile to the file in destfile. > 2. Copy the file in srcfile to the directory in destdir. > 3. Copy the directories in srcdir to the directory in destdir. > Includes and excludes are optional. When ommitted, all files > and directories are copied. > > Other attributes could be added like "forceoverwrite" which forces > the task not to check on timestamp. Also the already existing > "filtering" attribute could be added, although I'm in favor of > placing that in a separate task (Copy should do just a copy and > nothing more). > > For delete we could have the following combinations: > > 1. <delete file="file"/> > 2. <delete dir="dir" > includes="includes" excludes="excludes"/> > > 1. Delete the file in file. > 2. Delete all directories and files in dir, using the optional > includes and excludes. When ommitted, all files and directories > in dir are deleted. > > The move task (I think this is a better name than rename) could be: > > 1. <move srcfile="file" destfile="file"/> > 2. <move srcfile="file" destdir="dir"/> > 3. <move srcdir="dir" destdir="dir" > includes="includes" excludes="excludes"/> > > 1. Move the file in srcfile to the file in destfile. > 2. Move the file in srcfile to the directory in destdir. > 3. Move the directories in srcdir to the directory in destdir. > Includes and excludes are optional. When ommitted, all files > and directories are moved. > > Any comments? > > Arnout
