From 0e2cfd51d2dd546c3304993c1e39dde7081c6f8a Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Mon, 16 Aug 2004 21:56:24 +0000 Subject: [PATCH] differentiating between empty and up to date broke s. PR: 30567 git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@276783 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/tools/ant/DirectoryScanner.java | 20 +++++++++++++++++++ .../apache/tools/ant/taskdefs/ExecuteOn.java | 19 ++---------------- .../types/optional/depend/DependScanner.java | 11 ++++++++++ 3 files changed, 33 insertions(+), 17 deletions(-) diff --git a/src/main/org/apache/tools/ant/DirectoryScanner.java b/src/main/org/apache/tools/ant/DirectoryScanner.java index 3f6e214fe..275414c58 100644 --- a/src/main/org/apache/tools/ant/DirectoryScanner.java +++ b/src/main/org/apache/tools/ant/DirectoryScanner.java @@ -1053,6 +1053,16 @@ public class DirectoryScanner return files; } + /** + * Return the count of included files. + * @return int. + * @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 int. + * @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 diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java index 75b3a4835..9126d1e4d 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java @@ -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(); diff --git a/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java b/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java index 8fc39cd11..4964e83dc 100644 --- a/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java +++ b/src/main/org/apache/tools/ant/types/optional/depend/DependScanner.java @@ -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 */