ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: [SUBMIT] New <dependset> task, a task to manage arbitrary dependencies between files
Date Fri, 27 Jul 2001 07:36:59 GMT
I have some issues with the implementation of this task (which will be
a great built-in task IMHO).

On Wed, 18 Jul 2001, Craeg K. Strong <cstrong@arielpartners.com>
wrote:

> DESCRIPTION
> 
> The dependset task compares a set of source files with a set of
> target files. If any of the source files is more recent than any of
> the target files, all of the target files are removed.

Yes, this is the way it would be most useful. 8-) But the way you've
implemented it, seems to be backwards to me.

You compare each file from the target filesets to all files from the
source filesets with some special treatment for target files that
don't have a corresponding source.  This will not capture missing
target files.  You then determine all target files that are out of
date with respect to any source file and delete these files.

To me the more logical approach would be to compare source files to
target files, not giving targets as filesets but as a list of
filenames for the targets and remove all targets (not just the
outdated ones) if any of the source files is newer than the target
files or a target file doesn't exist?

Maybe I'm a little bit wrong wired this morning and totally wrong.

> Therefore, I chose to parameterize SourceFileScanner's comparison
> algorithm.  By default it works as before, but you can invert it by
> choosing a different FileComparator a la Strategy pattern.

Even though you wouldn't need it if you followed my route, I think
this is a useful extension and a better approach than subclassing
IMHO.  We may need to compare other things than timestamps in the
future ...

> You will notice that I also had to enhance MergingMapper slightly to
> accomodate multiple files.

Here I may have created a new Mapper type instead, but it works for me
both ways.

Stefan

Mime
View raw message