Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 72827 invoked from network); 30 Jul 2002 05:54:30 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 30 Jul 2002 05:54:30 -0000 Received: (qmail 20453 invoked by uid 97); 30 Jul 2002 05:54:56 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 20431 invoked by uid 97); 30 Jul 2002 05:54:55 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 10384 invoked by uid 98); 29 Jul 2002 09:01:48 -0000 X-Antivirus: nagoya (v4198 created Apr 24 2002) Message-ID: <3D450427.6020303@computer.org> Date: Mon, 29 Jul 2002 11:00:23 +0200 From: =?ISO-8859-1?Q?Guillaume_Cot=E9?= User-Agent: Mozilla/5.0 (Windows; U; WinNT4.0; en-US; rv:1.0.0) Gecko/20020530 X-Accept-Language: en-us, en MIME-Version: 1.0 To: ant-dev@jakarta.apache.org Subject: [PATCH] for bug 11214 : Make the uptodate task ignore a inexisting fileset Content-Type: multipart/mixed; boundary="------------060503040201050009080505" X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N --------------060503040201050009080505 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Hi, I want to change the behavior of the UpToDate task when it's called on a inexisting fileset. Now, it throws a exception like that one : 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. Please see bug 11214 for more details : http://nagoya.apache.org/bugzilla/show_bug.cgi?id=11214 Thanks -- Guillaume Cot� cote@computer.org --------------060503040201050009080505 Content-Type: text/plain; name="AbstractFileSet.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="AbstractFileSet.diff" --- AbstractFileSet.java.orig Mon Jul 29 10:44:25 2002 +++ AbstractFileSet.java Fri Jul 26 19:09:42 2002 @@ -316,6 +316,14 @@ return classname.substring(dotIndex + 1); } + public boolean exist(Project p) { + if (isReference()) { + return getRef(p).exist(p); + } + + return dir.exists(); + } + /** * Returns the directory scanner needed to access the files to process. */ --------------060503040201050009080505 Content-Type: text/plain; name="UpToDate.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="UpToDate.diff" --- UpToDate.java.orig Mon Jul 29 10:43:03 2002 +++ UpToDate.java Fri Jul 26 19:32:51 2002 @@ -196,9 +196,14 @@ boolean upToDate = true; while (upToDate && enum.hasMoreElements()) { FileSet fs = (FileSet) enum.nextElement(); - DirectoryScanner ds = fs.getDirectoryScanner(project); - upToDate = upToDate && scanDir(fs.getDir(project), - ds.getIncludedFiles()); + if (fs.exist(project)) { + DirectoryScanner ds = fs.getDirectoryScanner(project); + upToDate = upToDate && scanDir(fs.getDir(project), + ds.getIncludedFiles()); + } + else { + upToDate = false; + } } if (_sourceFile != null) { --------------060503040201050009080505 Content-Type: text/plain; charset=us-ascii -- To unsubscribe, e-mail: For additional commands, e-mail: --------------060503040201050009080505--