Browse Source

<apply> differentiating between empty and up to date broke <classfileset>s.

PR: 30567


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276783 13f79535-47bb-0310-9956-ffa450edef68
master
Matthew Jason Benson 21 years ago
parent
commit
0e2cfd51d2
3 changed files with 33 additions and 17 deletions
  1. +20
    -0
      src/main/org/apache/tools/ant/DirectoryScanner.java
  2. +2
    -17
      src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
  3. +11
    -0
      src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java

+ 20
- 0
src/main/org/apache/tools/ant/DirectoryScanner.java View File

@@ -1053,6 +1053,16 @@ public class DirectoryScanner
return files;
}

/**
* Return the count of included files.
* @return <CODE>int</CODE>.
* @since Ant 1.6.3
*/
public int getIncludedFilesCount() {
if (filesIncluded == null) throw new IllegalStateException();
return filesIncluded.size();
}

/**
* Returns the names of the files which matched none of the include
* patterns. The names are relative to the base directory. This involves
@@ -1121,6 +1131,16 @@ public class DirectoryScanner
return directories;
}

/**
* Return the count of included directories.
* @return <CODE>int</CODE>.
* @since Ant 1.6.3
*/
public int getIncludedDirsCount() {
if (dirsIncluded == null) throw new IllegalStateException();
return dirsIncluded.size();
}

/**
* Returns the names of the directories which matched none of the include
* patterns. The names are relative to the base directory. This involves


+ 2
- 17
src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java View File

@@ -43,18 +43,6 @@ import org.apache.tools.ant.util.SourceFileScanner;
*/
public class ExecuteOn extends ExecTask {

private class ExtendedDirectoryScanner extends DirectoryScanner {
public int getIncludedFilesCount() {
if (filesIncluded == null) throw new IllegalStateException();
return filesIncluded.size();
}

public int getIncludedDirsCount() {
if (dirsIncluded == null) throw new IllegalStateException();
return dirsIncluded.size();
}
}

protected Vector filesets = new Vector(); // contains AbstractFileSet
// (both DirSet and FileSet)
private Vector filelists = new Vector();
@@ -293,10 +281,7 @@ public class ExecuteOn extends ExecTask {
}
File base = fs.getDir(getProject());

ExtendedDirectoryScanner ds = new ExtendedDirectoryScanner();
fs.setupDirectoryScanner(ds, getProject());
ds.setFollowSymlinks(fs.isFollowSymlinks());
ds.scan();
DirectoryScanner ds = fs.getDirectoryScanner(getProject());

if (!"dir".equals(currentType)) {
String[] s = getFiles(base, ds);
@@ -379,7 +364,7 @@ public class ExecuteOn extends ExecTask {
}

if (fileNames.size() == 0 && skipEmpty) {
ExtendedDirectoryScanner ds = new ExtendedDirectoryScanner();
DirectoryScanner ds = new DirectoryScanner();
ds.setBasedir(base);
ds.setIncludes(list.getFiles(getProject()));
ds.scan();


+ 11
- 0
src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java View File

@@ -89,6 +89,12 @@ public class DependScanner extends DirectoryScanner {
return files;
}

//inherit doc
public int getIncludedFilesCount() {
if (included == null) throw new IllegalStateException();
return included.size();
}

/**
* Scans the base directory for files that baseClass depends on
*
@@ -159,6 +165,11 @@ public class DependScanner extends DirectoryScanner {
return new String[0];
}

//inherit doc
public int getIncludedDirsCount() {
return 0;
}

/**
* @see DirectoryScanner#getNotIncludedDirectories
*/


Loading…
Cancel
Save