Browse Source

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 :
          <exclude name="${ant.package}/taskdefs/TaskdefTest*Task.java"/>
:-(


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@274984 13f79535-47bb-0310-9956-ffa450edef68
master
Antoine Levy-Lambert 22 years ago
parent
commit
8b8cea1e30
1 changed files with 3 additions and 12 deletions
  1. +3
    -12
      src/main/org/apache/tools/ant/DirectoryScanner.java

+ 3
- 12
src/main/org/apache/tools/ant/DirectoryScanner.java View File

@@ -1004,19 +1004,10 @@ public class DirectoryScanner
* @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 <excludes.length; counter++) {
String shortexclude = SelectorUtils.rtrimWildcardTokens(excludes[counter]);
// here we are checking that the trimmed exclude pattern is not a plain directory
// <exclude name="foo"/> 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;


Loading…
Cancel
Save