You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Nikolay Diakov <DI...@cs.utwente.nl> on 2000/07/24 11:45:05 UTC

dependency

Hello,

This question may have been posted before.

I'm interested in something like a 'dependency aware pattern'.

When a specific task processes files, it normally uses input and
output filenames (probably using some patterns), that only differ in
the extension of their filenames. Provided this, what is the easiest
way to implement check for the time of the input files against the
time of the existing output files (if any) at the destination
directory. I would like to see a solution that does the checking with
the time of the source file and the output file time, and then decides
whether to pass it to the processing task to generate the new output
file.

I can implement this myself, just want to know whether somebody did
something like this already with the stadard task set comming with
ANT.

Regards,
  Nik



Re: dependency

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "ND" == Nikolay Diakov <DI...@cs.utwente.nl> writes:

 ND> I can implement this myself, just want to know whether somebody
 ND> did something like this already with the stadard task set comming
 ND> with ANT.

This kind of functionality occurs over and over again inside the
standard tasks - just look for scanDir methods. I've been meaning to
move this to a helper class and - apart from modifying the existing
tasks - add a <transform> task that would be an <exec> like task that
used this helper to work on a set of files.

Unfortunately I've been a little bit swamped with other things but
hope to get to this issue rather soon.

Starting out with pattern matching on a from=".java" to=".class"
would be fine but I'd like to see this open enough for custom tasks to
create more complex rules to find target files from sources (take
Rmic's logic for example).

What do you think?

Stefan

Re: dependency

Posted by Stefan Bodewig <bo...@bost.de>.
I forgot, there has been an <available> like task named <obsolete>
posted to this list a while back, you should be able to pull it from
the archive.

Basically this took a list of source and destination files and set a
property if one of the source files was newer than one of the
destination files. You could then use the if/unless attributes on
targets to conditionally execute a command.

This might not fully fit your requirements but could give you a start.

Stefan