Browse Source

Make <fail> support nested text.

Submitted by:	Tim Dawson <tdawson@wamnet.com>


git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268900 13f79535-47bb-0310-9956-ffa450edef68
master
Stefan Bodewig 24 years ago
parent
commit
7c3493aaa3
3 changed files with 20 additions and 4 deletions
  1. +6
    -4
      WHATSNEW
  2. +5
    -0
      docs/manual/CoreTasks/fail.html
  3. +9
    -0
      src/main/org/apache/tools/ant/taskdefs/Exit.java

+ 6
- 4
WHATSNEW View File

@@ -10,10 +10,6 @@ Changes that could break older environments:
rmic to use a new compiler a lot easier but may break custom
versions of this task that rely on the old implementation.

* <touch> can now work on <fileset>s

* <uptodate> now supports a value attribute

Other changes:
--------------

@@ -27,6 +23,12 @@ Other changes:

* you can now specify a description for <p4change>

* <touch> can now work on <fileset>s

* <uptodate> now supports a value attribute

* <fail> supports nested text

Fixed bugs:
-----------



+ 5
- 0
docs/manual/CoreTasks/fail.html View File

@@ -10,6 +10,8 @@
<h2><a name="fail">Fail</a></h2>
<h3>Description</h3>
<p>Exits the current build (just throwing a BuildException), optionally printing additional information.</p>
<p>The message of the Exception can be set via the message attribute
or character data nested into the element.</p>
<h3>Parameters</h3>
<table border="1" cellpadding="2" cellspacing="0">
<tr>
@@ -41,6 +43,9 @@ BUILD FAILED
build.xml:4: Something wrong here.
</pre>

<pre> &lt;fail&gt;Something wrong here.&lt;/fail&gt;</pre>
<p>will give the same result as above.</p>

<hr>
<p align="center">Copyright &copy; 2000,2001 Apache Software Foundation. All rights
Reserved.</p>


+ 9
- 0
src/main/org/apache/tools/ant/taskdefs/Exit.java View File

@@ -76,4 +76,13 @@ public class Exit extends Task {
throw new BuildException("No message");
}
}

/**
* Set a multiline message.
*/
public void addText(String msg) {
message +=
ProjectHelper.replaceProperties(project, msg, project.getProperties());
}

}

Loading…
Cancel
Save