ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 11214] New: - Uptodate should ignore on not exiting fileset
Date Fri, 26 Jul 2002 17:43:02 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11214>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11214

Uptodate should ignore on not exiting fileset

           Summary: Uptodate should ignore on not exiting fileset
           Product: Ant
           Version: 1.5
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Core tasks
        AssignedTo: ant-dev@jakarta.apache.org
        ReportedBy: cote@computer.org


I have a build file which check for the existance of generated files.  I get the
following exception when I do a build.

file:/home/gce/dev/bilansService/build/build.xml:419:
/home/gce/dev/bilansService/work/src not found.
        at
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:341)
        at
org.apache.tools.ant.types.AbstractFileSet.getDirectoryScanner(AbstractFileSet.java:332)
        at org.apache.tools.ant.taskdefs.UpToDate.eval(UpToDate.java:199)
        at org.apache.tools.ant.taskdefs.UpToDate.execute(UpToDate.java:235)
        at org.apache.tools.ant.Task.perform(Task.java:317)
        at org.apache.tools.ant.Target.execute(Target.java:309)
        at org.apache.tools.ant.Target.performTasks(Target.java:334)
        at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
        at org.apache.tools.ant.Project.executeTargets(Project.java:1250)
        at org.apache.tools.ant.Main.runBuild(Main.java:610)
        at org.apache.tools.ant.Main.start(Main.java:196)
        at org.apache.tools.ant.Main.main(Main.java:235)

I would like the uptodate tasks to simply ignore inexisting directory and
consider that the file can not uptodate.


For that, two file need to be modified.  The following method should be added in 
AbstractFileSet.java

    public boolean exist(Project p) {
        if (isReference()) {
            return getRef(p).exist(p);
        }

        return dir.exists();
    }

Then, those three lines of the method eval() of uptodate 

            DirectoryScanner ds = fs.getDirectoryScanner(project);
            upToDate = upToDate && scanDir(fs.getDir(project), 
                                           ds.getIncludedFiles());

should be replaced by

            if (fs.exist(project)) {
                DirectoryScanner ds = fs.getDirectoryScanner(project);
                upToDate = upToDate && scanDir(fs.getDir(project), 
                                               ds.getIncludedFiles());
            }
            else {
                upToDate = false;
            }

Sorry, I cannot provide a clean patch due to my firewall.

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


Mime
View raw message