ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <>
Subject Re: Ant 2.0 Consideration
Date Fri, 15 Dec 2000 09:32:54 GMT
James Cook <> wrote:

>> -----Original Message-----
>> From: Stefan Bodewig []
>> > I need to be able to ask each Task if a particular file is
>> > affected by the Task.
>> How would this apply to echo/sql/property ...?
> Tasks that do not deal with Filesets would return false when asked
> about a particular file.


>> > For example, given a particular File object, I should be able to
>> > ask a Copy Task if it will include this task.  Since the Copy
>> > Task does not extend MatchingTask, this becomes impossible.
>> Why? Or better, why would this be possible if Copy extended
>> MatchingTask?
> Because MatchingTask (or FileSet) can (or could) answer the
> question, "Is this file included/excluded from your scope?"

But this is a runtime thing in many situations. <copy> would affect a
file that is part of a defined fileset and that is newer than the
target file - so it could say "yes, would copy it right now" but as
soon as you execute the task once, the answer will become no - as long
as you don't change the file again.

So the IDE could know whether the next invocation of that task would
affect a given file - but only as long as nothing changes on the
filesystem. This is going to lead to a lot of disk-scanning unless the
IDE can be sure it's the only one accessing the project's files.

> I envision a system where the developer can assign a task at a high
> level, perhaps the project or package level. Then the developer can
> select which files will participate in the task. Maybe when a file
> is selected, it is shown all of the tasks that have been declared
> "above" it. The developer could then check off which tasks that file
> will or won't participate in. The methods that I mentioned
> previously would help faciliate keeping track of which tasks a
> particular file is participating in.

I think this would be breaking Ant's paradigm. Tasks are the smallest
units of work, but you cannot really invoke a task, the smallest part
accessible to the user is the target. Targets need to make sure the
targets they depend on have been executed before.

So the best thing one could do is (1) find all tasks that affect a
given file and (2) list the targets they live in to give the user a
choice of targets to execute - but not to discard some targets as Ant
may need to invoke them as part of the dependencies of another target.

Is this what you'd like to see? I'm afraid I'm still not absolutely
clear on what you want, sorry.


View raw message