From 982db474ca24f7c65bcc07ab553f100b4f39b3e0 Mon Sep 17 00:00:00 2001
From: Stefan Bodewig
chmod
command. Defaults to true.
@@ -1548,10 +1556,10 @@ system command.Executes a system command. When the os attribute is specified, then the command is only executed when Ant is run on one of the specified operating systems.
-The files of a number of FileSets are passed -as arguments to the system command. At least one nested -
+<fileset>
or<filesetref>
is -required.The files and/or directories of a number of FileSets are passed as arguments to the system +command. At least one nested
<fileset>
or +<filesetref>
is required.Parameters
@@ -1601,6 +1609,14 @@ required. once for every file. +No + type +One of file, dir or + both. If set to file, only the names of plain + files will be sent to the command. If set to dir, only + the names of directories are considered. +No, default is file +Parameters specified as nested elements
fileset and filesetref
diff --git a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java index b96b520db..baca677be 100644 --- a/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java +++ b/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java @@ -71,6 +71,7 @@ public class ExecuteOn extends ExecTask { protected Vector filesets = new Vector(); private boolean parallel = false; + protected String type = "file"; /** * Adds a set of files (nested fileset attribute). @@ -93,6 +94,13 @@ public class ExecuteOn extends ExecTask { this.parallel = parallel; } + /** + * Shall the command work only on files, directories or both? + */ + public void setType(FileDirBoth type) { + this.type = type.getValue(); + } + protected void checkConfiguration() { super.checkConfiguration(); if (filesets.size() == 0) { @@ -122,9 +130,18 @@ public class ExecuteOn extends ExecTask { } DirectoryScanner ds = fs.getDirectoryScanner(project); - String[] s = ds.getIncludedFiles(); - for (int j=0; j