PR: 30567 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276783 13f79535-47bb-0310-9956-ffa450edef68master
| @@ -1053,6 +1053,16 @@ public class DirectoryScanner | |||||
| return files; | 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 | * Returns the names of the files which matched none of the include | ||||
| * patterns. The names are relative to the base directory. This involves | * patterns. The names are relative to the base directory. This involves | ||||
| @@ -1121,6 +1131,16 @@ public class DirectoryScanner | |||||
| return directories; | 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 | * Returns the names of the directories which matched none of the include | ||||
| * patterns. The names are relative to the base directory. This involves | * patterns. The names are relative to the base directory. This involves | ||||
| @@ -43,18 +43,6 @@ import org.apache.tools.ant.util.SourceFileScanner; | |||||
| */ | */ | ||||
| public class ExecuteOn extends ExecTask { | 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 | protected Vector filesets = new Vector(); // contains AbstractFileSet | ||||
| // (both DirSet and FileSet) | // (both DirSet and FileSet) | ||||
| private Vector filelists = new Vector(); | private Vector filelists = new Vector(); | ||||
| @@ -293,10 +281,7 @@ public class ExecuteOn extends ExecTask { | |||||
| } | } | ||||
| File base = fs.getDir(getProject()); | 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)) { | if (!"dir".equals(currentType)) { | ||||
| String[] s = getFiles(base, ds); | String[] s = getFiles(base, ds); | ||||
| @@ -379,7 +364,7 @@ public class ExecuteOn extends ExecTask { | |||||
| } | } | ||||
| if (fileNames.size() == 0 && skipEmpty) { | if (fileNames.size() == 0 && skipEmpty) { | ||||
| ExtendedDirectoryScanner ds = new ExtendedDirectoryScanner(); | |||||
| DirectoryScanner ds = new DirectoryScanner(); | |||||
| ds.setBasedir(base); | ds.setBasedir(base); | ||||
| ds.setIncludes(list.getFiles(getProject())); | ds.setIncludes(list.getFiles(getProject())); | ||||
| ds.scan(); | ds.scan(); | ||||
| @@ -89,6 +89,12 @@ public class DependScanner extends DirectoryScanner { | |||||
| return files; | 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 | * Scans the base directory for files that baseClass depends on | ||||
| * | * | ||||
| @@ -159,6 +165,11 @@ public class DependScanner extends DirectoryScanner { | |||||
| return new String[0]; | return new String[0]; | ||||
| } | } | ||||
| //inherit doc | |||||
| public int getIncludedDirsCount() { | |||||
| return 0; | |||||
| } | |||||
| /** | /** | ||||
| * @see DirectoryScanner#getNotIncludedDirectories | * @see DirectoryScanner#getNotIncludedDirectories | ||||
| */ | */ | ||||