bodewig 01/05/22 02:56:15
Modified: docs/manual/CoreTasks apply.html
src/main/org/apache/tools/ant/taskdefs Chmod.java
ExecuteOn.java
Log:
Add skipemptyfilesets attributes to <execon> and <apply>.
PR: 1277
Revision Changes Path
1.4 +7 -0 jakarta-ant/docs/manual/CoreTasks/apply.html
Index: apply.html
===================================================================
RCS file: /home/cvs/jakarta-ant/docs/manual/CoreTasks/apply.html,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- apply.html 2001/04/04 11:44:48 1.3
+++ apply.html 2001/05/22 09:56:02 1.4
@@ -72,6 +72,13 @@
<td align="center" valign="top">No, default is <i>false</i></td>
</tr>
<tr>
+ <td valign="top">skipemptyfilesets</td>
+ <td valign="top">Don't run the command, if no source files have
+ been found or are newer than their corresponding target
+ files.</td>
+ <td align="center" valign="top">No, default is <i>false</i></td>
+ </tr>
+ <tr>
<td valign="top">parallel</td>
<td valign="top">Run the command only once, appending all files as
arguments. If false, command will be executed once for every file.
1.14 +5 -0
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java
Index: Chmod.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Chmod.java,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -r1.13 -r1.14
--- Chmod.java 2001/03/17 15:24:47 1.13
+++ Chmod.java 2001/05/22 09:56:09 1.14
@@ -77,6 +77,7 @@
public Chmod() {
super.setExecutable("chmod");
super.setParallel(true);
+ super.setSkipEmptyFilesets(true);
}
public void setFile(File src) {
@@ -192,6 +193,10 @@
public void setCommand(String e) {
throw new BuildException(taskType+" doesn\'t support the command
attribute", location);
+ }
+
+ public void setSkipEmptyFilesets(boolean skip) {
+ throw new BuildException(taskType+" doesn\'t support the
skipemptyfileset attribute", location);
}
protected boolean isValidOs() {
1.13 +14 -0
jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java
Index: ExecuteOn.java
===================================================================
RCS file:
/home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/ExecuteOn.java,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- ExecuteOn.java 2001/03/13 03:04:06 1.12
+++ ExecuteOn.java 2001/05/22 09:56:10 1.13
@@ -73,6 +73,7 @@
private boolean parallel = false;
protected String type = "file";
protected Commandline.Marker srcFilePos = null;
+ private boolean skipEmpty = false;
/**
* Adds a set of files (nested fileset attribute).
@@ -96,6 +97,13 @@
}
/**
+ * Should empty filesets be ignored?
+ */
+ public void setSkipEmptyFilesets(boolean skip) {
+ skipEmpty = skip;
+ }
+
+ /**
* Marker that indicates where the name of the source file should
* be put on the command line.
*/
@@ -136,6 +144,12 @@
for (int j=0; j<s.length; j++) {
v.addElement(s[j]);
}
+ }
+
+ if (v.size() == 0 && skipEmpty) {
+ log("Skipping fileset for directory "
+ + base + ". It is empty.", Project.MSG_INFO);
+ continue;
}
String[] s = new String[v.size()];