Return-Path: Delivered-To: apmail-ant-dev-archive@ant.apache.org Received: (qmail 4150 invoked by uid 500); 29 Jul 2003 20:57:32 -0000 Mailing-List: contact dev-help@ant.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 dev@ant.apache.org Received: (qmail 4131 invoked from network); 29 Jul 2003 20:57:31 -0000 Received: from relay.t-intra.de (HELO relay.t-online-com.de) (62.156.147.74) by daedalus.apache.org with SMTP; 29 Jul 2003 20:57:31 -0000 Received: from DJ0X820J (p5080e867.dip0.t-ipconnect.de [80.128.232.103]) by relay.t-online-com.de (SMTPSVC(1.0.0.2)) with ESMTP id 3CAA614CA95 for ; Tue, 29 Jul 2003 23:58:25 +0200 (CEST) Message-ID: <008601c3560c$29a0dbb0$020200c0@DJ0X820J> From: "Antoine Levy-Lambert" To: "Ant Developers List" References: <20030729194716.77158.qmail@icarus.apache.org> Subject: Re: cvs commit: ant/src/main/org/apache/tools/ant DirectoryScanner.java Date: Tue, 29 Jul 2003 22:01:12 +0200 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1106 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I had done a big mistake in my attempt to improve DirectoryScanner by not scanning directories matching exclude patterns. I realized this when I ran the ant test suite which took 1 minute instead of the usual 5. This is fixed now. This routine to decide when exclude patterns are enough to stop scanning a part of the directory tree can still be improved. Right now, it will halt the scan of foo/bar if there is an exclude pattern foo/bar/** but not if there is an exclude pattern **/bar/** or FOO/BAR/** on case insensitive systems. Cheers, Antoine ----- Original Message ----- From: Sent: Tuesday, July 29, 2003 9:47 PM > antoine 2003/07/29 12:47:16 > > Modified: src/main/org/apache/tools/ant DirectoryScanner.java > Log: > the method isMorePowerfulThanExcludes was returning false on org/apache/tools/ant/taskdefs > in the run-tests target of our buildfile because of the exclude pattern : > > :-( > > Revision Changes Path > 1.61 +3 -12 ant/src/main/org/apache/tools/ant/DirectoryScanner.java > > Index: DirectoryScanner.java > =================================================================== > RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/DirectoryScanner.java,v > retrieving revision 1.60 > retrieving revision 1.61 > diff -u -r1.60 -r1.61 > --- DirectoryScanner.java 29 Jul 2003 10:49:11 -0000 1.60 > +++ DirectoryScanner.java 29 Jul 2003 19:47:16 -0000 1.61 > @@ -1004,19 +1004,10 @@ > * @since ant1.6 > */ > private boolean isMorePowerfulThanExcludes(String name, String includepattern) { > - String shortpattern = SelectorUtils.rtrimWildcardTokens(includepattern); > + String soughtexclude = name + File.separator + "**"; > for (int counter=0; counter - String shortexclude = SelectorUtils.rtrimWildcardTokens(excludes[counter]); > - // here we are checking that the trimmed exclude pattern is not a plain directory > - // means exclude only the directory foo, but not its subdirs > - if (shortexclude.length() < excludes[counter].length()) { > - if (excludes[counter].charAt(shortexclude.length()) == File.separatorChar) { > - if (matchPath(shortexclude, name, isCaseSensitive)) { > - if (shortexclude.length() > shortpattern.length()) { > - return false; > - } > - } > - } > + if (excludes[counter].equals(soughtexclude)) { > + return false; > } > } > return true; > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org > For additional commands, e-mail: dev-help@ant.apache.org > > --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org For additional commands, e-mail: dev-help@ant.apache.org