You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Mariusz Nowostawski <ma...@marni.otago.ac.nz> on 2000/05/26 01:40:44 UTC

Matching tasks look&feel?

So what is eventually agreed for all matching tasks to look like?

We have two cases:

a) task takes a single file (or directory) as an argument, 
   and the user wants to specify it directly.
b) the task takes a list of files which is build from a directory and
   constrained by include/exclude pattern.

Thus we have two major options:
1. "Strict-typing"  
 a)  <task file="file.dat" .... />
 b)  <task dir="dir" .... includes="*.dat" />

2. "Dynamic-typing"
 a)  <task src="file.dat" .... />   
 b)  <task src="dir" .... includes="*.dat" />


It is obvious that for 1. any of the below does not make sense,
and need to throw a build exception (i would think):
 a)
  <task file="dir" .... includes="*.dat" />
  <task file="file.dat" .... includes="*.dat" />
 b)
  <task dir="file.dat" .... />

Any other options? 
I do not have very strong opinion about it, however I like 2. a little
more.. if people are more into explicit things, 1. is fine with me as
well...   but I suggest we agree on one, and make all tasks uniform ;o)


Mariusz


Re: Matching tasks look&feel?

Posted by Ernst de Haan <er...@c187104187.telekabel.chello.nl>.
Stefan wrote:
> In case of the delete task I'd really prefer to have an distinction
> between dir and file because of the damage one could do by accident -
> only alternative I see is a recurse attribute with default false.

Hmm, this sounds like a good idea, IMHO. That is the way the UNIX/Linux
commands work:

	rm -R /home/ernst/tmp
	ls -R
	chmod -R a+r *

So I'd say don't distinguish between files and directories, and just add
an attribute `resursive' or `recurse' and set the default value to
`false'.

A +1.01 vote for me :)


Ernst

Re: Matching tasks look&feel?

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "MN" == Mariusz Nowostawski <ma...@marni.otago.ac.nz> writes:

 MN> So what is eventually agreed for all matching tasks to look like?

 MN> Thus we have two major options:

 MN> 1. "Strict-typing"  
 MN>  a)  <task file="file.dat" .... />
 MN>  b)  <task dir="dir" .... includes="*.dat" />

 MN> 2. "Dynamic-typing"
 MN>  a)  <task src="file.dat" .... />   
 MN>  b)  <task src="dir" .... includes="*.dat" />

In case of the delete task I'd really prefer to have an distinction
between dir and file because of the damage one could do by accident -
only alternative I see is a recurse attribute with default false.

Then take a look at your own patch to Chmod. You support a chmod on a
directory without recursion by <chmod file="dir" ... /> and a recursive
one by <chmod dir="dir" ... />. Without different attributes you would
need includes/excludes if you only want to affect the top dir.

Therefore I'd prefer strict-typing (but you could see this a a -0.5 if
I were to vote).

Stefan