> -----Original Message----- > From: Dominique Devienne [mailto:DDevienne@;lgc.com] > Sent: Tuesday, October 22, 2002 11:27 AM > To: 'Ant Users List' > Subject: RE: Uptodate checking... > > > In what way if not using the UpToDate task superior? In the > following code > of mine, it doesn't look to me than using SourceFileScanner > would have been > more explicit or 'better'. Thanks to let me know, --DD > > private boolean isUp2date(File target, File dir, > List includes, List excludes) > throws BuildException { > PatternSet patternset = null; > > FileSet fileset = new FileSet(); > fileset.setProject(getProject()); > fileset.setDir(dir); > > if (includes.size() + excludes.size() > 0) { > patternset = fileset.createPatternSet(); > } > > <snip message="add include/exclude patterns"/> > > UpToDate up2date = new UpToDate(); > configureTask(up2date); > > up2date.setTargetFile(target); > up2date.addSrcfiles(fileset); > > return up2date.eval(); > } >
I think it depends on the behavior you desire. In your example it looks like you want to do the entire task if one or more files are out-of-date. In some cases, i.e. <javac>, you will still perform the task, but only on the out-of-date files. Am I understanding the differences correctly? /mike
