ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From David Medinets <>
Subject DirectoryScanner & Excluding Directories
Date Wed, 13 Sep 2000 21:30:45 GMT
I hope the following is understandable.

In the scandir method of DirectoryScanner, the code looks like this for

    if (isIncluded(name)) {
        if (!isExcluded(name)) {
            if (fast) {
              scandir(file, name+File.separator, fast);
        } else {
    } else {
        if (fast && couldHoldIncluded(name)) {
            scandir(file, name+File.separator, fast);

However, I'd like to use the following xml in my build.xml file:

      <AnalyzeRequest debug="yes" srcdir="${src}">
         <include name="*.cfm"/>
         <exclude name="images"/>

I feel the above exclude should work, but it doesn't because if IsExcluded
test only occurs inside the IsIncluded test.

My solution was to wrap the whole above if statement with:

    if (isExcluded(name)) {
    else { 
        ... the original if statement

        ... move the scandir call here so that
        ... we don't recurse through excluded directories.

Comments? Is this a change that should find its way into the main code

View raw message