You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by st...@apache.org on 2007/11/22 18:11:27 UTC
svn commit: r597455 - in /ant/core/trunk: WHATSNEW
src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
Author: stevel
Date: Thu Nov 22 09:11:26 2007
New Revision: 597455
URL: http://svn.apache.org/viewvc?rev=597455&view=rev
Log:
Bugzilla Bug 43624
symlink task failonerror="false" does not stop build from failing when 'ln' command returns non-zero
Modified:
ant/core/trunk/WHATSNEW
ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
Modified: ant/core/trunk/WHATSNEW
URL: http://svn.apache.org/viewvc/ant/core/trunk/WHATSNEW?rev=597455&r1=597454&r2=597455&view=diff
==============================================================================
--- ant/core/trunk/WHATSNEW (original)
+++ ant/core/trunk/WHATSNEW Thu Nov 22 09:11:26 2007
@@ -46,6 +46,9 @@
* <symlink> task couldn't overwrite files that were in the way of the symlink.
Bugzilla report 43426.
+
+ * <symlink> task failonerror="false" does not stop build from failing when 'ln'
+ command returns non-zero. Bugzilla report 43624
* <touch> task couldn't differentiate between "no resources specified" and "no resources
matched." Bugzilla report 43799.
Modified: ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java
URL: http://svn.apache.org/viewvc/ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java?rev=597455&r1=597454&r2=597455&view=diff
==============================================================================
--- ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java (original)
+++ ant/core/trunk/src/main/org/apache/tools/ant/taskdefs/optional/unix/Symlink.java Thu Nov 22 09:11:26 2007
@@ -443,6 +443,7 @@
*
* @param properties The properties object to be written.
* @param dir The directory for which we are writing the links.
+ * @throws BuildException if the property file could not be written
*/
private void writePropertyFile(Properties properties, File dir)
throws BuildException {
@@ -498,7 +499,16 @@
}
}
String[] cmd = new String[] {"ln", options, res, lnk};
- Execute.runCommand(this, cmd);
+ try {
+ Execute.runCommand(this, cmd);
+ } catch (BuildException failedToExecute) {
+ if(failonerror) {
+ throw failedToExecute;
+ } else {
+ //log at the info level, and keep going.
+ log(failedToExecute.getMessage(), failedToExecute, Project.MSG_INFO);
+ }
+ }
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org