ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Sieben (EUS)" <EUSJ...@am1.ericsson.se>
Subject RE: Possible Exec and MatchingTask Refactorings
Date Tue, 27 Jun 2000 14:56:42 GMT
	I really like the worklist idea. That would allow me to specify some
patterns at the top of the file and reuse them all the way down, sort of
like a CSS for build.xml sort of thing. That way, if I want to compile a
complicated set of sources, and then javadoc, archive, and email them, I
don't need to specify the pattern 4 times.
	Being a new guy coming to Ant, however, I wonder why nesting of tags
is not used mroe to help organize these issues. Why not have a tag like
<worklist> which can have a sequential set of sub-tasks inside it, that
execute on that same set of files? That way Exec could always execute within
a known context, and build.xml writers could have the freedom to choose
MatchingTask functionality or not; exec wouldn't care. Comments?

-----Original Message-----
From: Tom Dimock [mailto:tad1@cornell.edu]
Sent: Tuesday, June 27, 2000 8:30 AM
To: ant-dev@jakarta.apache.org
Subject: Re: Possible Exec and MatchingTask Refactorings


At 11:34 AM 06/27/2000 +0200, Stefan wrote:
>* There are at least three ways I could understand a file list provided
>to a plain exec task:
>
>(1) Run the command on each of the files - once per file - and always
>add the filename to the command line (probably as the last argument).
>
>(2) Run the command on all of the files at once - add all filenames as
>arguments to the command line (probably as the last arguments).
>
>(3) Run the filenames as the command to execute.

Going in a slightly different direction with this, how about a <worklist>
task which creates a named list of files?  <worklist> would be a
MatchingTask, saving the generated list of files under a name wich could be
referenced similar to a property. Then your three ways become:

(1) <worklist name="myFiles" dir=...   includes=...    />
    <exec command="whatever" dir="${myFiles}"    />

(2) <worklist name="myFiles" dir=...   includes=...    />
    <exec command="whatever ${myFiles}" dir="."    />

(3) <worklist name="myCmds" dir=...   includes=...    />
    <exec command="${myCmds}" dir="."    />

This could then even take your 54 test cases example and run each of them
on you 20 sets of test data:

(4) <worklist name="myCmds" dir=...   includes=...    />
    <worklist name="myFiles" dir=...   includes=...    />
    <exec command="${myCmds}" dir="${myFiles}"    />

Of course this is pretty seriously mangling the syntax as shown, but there
has been talk of redoing the ${} syntax anyways....
 
----------------------------------------------------------------------------
       Tom Dimock  ----  Cornell University  ----  tad1@cornell.edu
"There go my people.  I must follow them, for I am their leader."  M. Gandhi


Mime
View raw message