ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: Uptodate checking...
Date Tue, 22 Oct 2002 18:27:26 GMT
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();
  }

-----Original Message-----
From: Stefan Bodewig [mailto:bodewig@apache.org] 
Sent: Tuesday, October 22, 2002 1:13 AM
To: ant-user@jakarta.apache.org
Subject: Re: Uptodate checking...

On Mon, 21 Oct 2002, Mike Dougherty <MDougherty@xifin.com> wrote:

> Is using the UpToDate object inside my execute() method the
> easiest/best way to do this? Is there a better (read cleaner) way to
> do what I want?

I think there is a better way, yes.  Just look how UpToDate works, it
delegates most to org.apache.tools.ant.util.SourceFileScanner.  With a
Mapper of your own (tailored with the knowledge only your task can
have), you may get something better suited to your specific task.

> P.S. This may be a ant-dev list question.

I think it is - well, sort of.

Stefan

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>

--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message