You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by pe...@apache.org on 2005/03/07 10:37:43 UTC
cvs commit: ant WHATSNEW CONTRIBUTORS
peterreilly 2005/03/07 01:37:43
Modified: src/main/org/apache/tools/ant/taskdefs SubAnt.java
docs/manual/CoreTasks subant.html
. WHATSNEW CONTRIBUTORS
Log:
add verbose attribute to <subant> task
PR: 33787
Obtained from: Craig Ryan, Frank Somers
Revision Changes Path
1.23 +27 -0 ant/src/main/org/apache/tools/ant/taskdefs/SubAnt.java
Index: SubAnt.java
===================================================================
RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/taskdefs/SubAnt.java,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- SubAnt.java 18 Feb 2005 23:27:59 -0000 1.22
+++ SubAnt.java 7 Mar 2005 09:37:43 -0000 1.23
@@ -65,6 +65,7 @@
private String subTarget = null;
private String antfile = "build.xml";
private File genericantfile = null;
+ private boolean verbose = false;
private boolean inheritAll = false;
private boolean inheritRefs = false;
private boolean failOnError = true;
@@ -180,11 +181,16 @@
BuildException buildException = null;
for (int i = 0; i < count; ++i) {
File file = null;
+ String subdirPath = null;
Throwable thrownException = null;
try {
File directory = null;
file = new File(filenames[i]);
if (file.isDirectory()) {
+ if (verbose) {
+ subdirPath = file.getPath();
+ log("Entering directory: " + subdirPath + "\n", Project.MSG_INFO);
+ }
if (genericantfile != null) {
directory = file;
file = genericantfile;
@@ -193,13 +199,22 @@
}
}
execute(file, directory);
+ if (verbose && subdirPath != null) {
+ log("Leaving directory: " + subdirPath + "\n", Project.MSG_INFO);
+ }
} catch (RuntimeException ex) {
if (!(getProject().isKeepGoingMode())) {
+ if (verbose && subdirPath != null) {
+ log("Leaving directory: " + subdirPath + "\n", Project.MSG_INFO);
+ }
throw ex; // throw further
}
thrownException = ex;
} catch (Throwable ex) {
if (!(getProject().isKeepGoingMode())) {
+ if (verbose && subdirPath != null) {
+ log("Leaving directory: " + subdirPath + "\n", Project.MSG_INFO);
+ }
throw new BuildException(ex);
}
thrownException = ex;
@@ -223,6 +238,9 @@
new BuildException(thrownException);
}
}
+ if (verbose && subdirPath != null) {
+ log("Leaving directory: " + subdirPath + "\n", Project.MSG_INFO);
+ }
}
}
// check if one of the builds failed in keep going mode
@@ -324,6 +342,15 @@
}
/**
+ * Enable/ disable verbose log messages showing when each sub-build path is entered/ exited.
+ * The default value is "false".
+ * @param on true to enable verbose mode, false otherwise (default).
+ */
+ public void setVerbose(boolean on) {
+ this.verbose = on;
+ }
+
+ /**
* Corresponds to <code><ant></code>'s
* <code>output</code> attribute.
*
1.13 +18 -3 ant/docs/manual/CoreTasks/subant.html
Index: subant.html
===================================================================
RCS file: /home/cvs/ant/docs/manual/CoreTasks/subant.html,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -r1.12 -r1.13
--- subant.html 19 Nov 2004 09:07:09 -0000 1.12
+++ subant.html 7 Mar 2005 09:37:43 -0000 1.13
@@ -128,7 +128,7 @@
<td bgcolor="#eeeeee" valign="top" align="left">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">String</font>
</td>
- <td bgcolor="#eeeeee" valign="top" align="left" rowspan="9">
+ <td bgcolor="#eeeeee" valign="top" align="left" rowspan="10">
<font color="#000000" size="-1" face="arial,helvetica,sanserif">Optional</font>
</td>
</tr>
@@ -229,6 +229,21 @@
</td>
</tr>
+ <!-- Attribute -->
+ <tr>
+ <td bgcolor="#eeeeee" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">verbose</font>
+ </td>
+ <td bgcolor="#eeeeee" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">
+ Enable/ disable log messages showing when each sub-build path is entered/ exited.
+ The default value is false.</font>
+ </td>
+ <td bgcolor="#eeeeee" valign="top" align="left">
+ <font color="#000000" size="-1" face="arial,helvetica,sanserif">boolean</font>
+ </td>
+ </tr>
+
</table>
</blockquote></td></tr>
@@ -491,7 +506,7 @@
<tr>
<td>
<div align="center"><font color="#525D76" size="-1"><em>
- Copyright © 2000-2004, The Apache Software Foundation. All Rights Reserved.
+ Copyright © 2000-2005, The Apache Software Foundation. All Rights Reserved.
</em></font></div>
</td>
</tr>
@@ -499,4 +514,4 @@
</table>
</body>
-</html>
\ No newline at end of file
+</html>
1.765 +3 -0 ant/WHATSNEW
Index: WHATSNEW
===================================================================
RCS file: /home/cvs/ant/WHATSNEW,v
retrieving revision 1.764
retrieving revision 1.765
diff -u -r1.764 -r1.765
--- WHATSNEW 4 Mar 2005 22:32:46 -0000 1.764
+++ WHATSNEW 7 Mar 2005 09:37:43 -0000 1.765
@@ -248,6 +248,9 @@
* Added isfileselected condition.
+* Added verbose="true|false" attribute to <subant>. When verbose is enabled,
+ the directory name is logged on entry and exit of the sub-build. Bugzilla 33787.
+
Fixed bugs:
-----------
1.43 +2 -0 ant/CONTRIBUTORS
Index: CONTRIBUTORS
===================================================================
RCS file: /home/cvs/ant/CONTRIBUTORS,v
retrieving revision 1.42
retrieving revision 1.43
diff -u -r1.42 -r1.43
--- CONTRIBUTORS 11 Jan 2005 18:30:34 -0000 1.42
+++ CONTRIBUTORS 7 Mar 2005 09:37:43 -0000 1.43
@@ -32,6 +32,7 @@
Craeg Strong
Craig Cottingham
Craig R. McClanahan
+Craig Ryan
Curtis White
Cyrille Morvan
Dale Anson
@@ -63,6 +64,7 @@
Erik Meade
Ernst de Haan
Frederic Lavigne
+Frank Somers
Gary S. Weaver
Gautam Guliani
Gero Vermaas
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org