From 7c3493aaa36b2c094e340c4e4a86242aad979c54 Mon Sep 17 00:00:00 2001 From: Stefan Bodewig Date: Thu, 29 Mar 2001 10:21:12 +0000 Subject: [PATCH] Make support nested text. Submitted by: Tim Dawson git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@268900 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 10 ++++++---- docs/manual/CoreTasks/fail.html | 5 +++++ src/main/org/apache/tools/ant/taskdefs/Exit.java | 9 +++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) diff --git a/WHATSNEW b/WHATSNEW index 0b044159a..6d2736df9 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -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. -* can now work on s - -* now supports a value attribute - Other changes: -------------- @@ -27,6 +23,12 @@ Other changes: * you can now specify a description for +* can now work on s + +* now supports a value attribute + +* supports nested text + Fixed bugs: ----------- diff --git a/docs/manual/CoreTasks/fail.html b/docs/manual/CoreTasks/fail.html index 3fc76814c..3b7c26650 100644 --- a/docs/manual/CoreTasks/fail.html +++ b/docs/manual/CoreTasks/fail.html @@ -10,6 +10,8 @@

Fail

Description

Exits the current build (just throwing a BuildException), optionally printing additional information.

+

The message of the Exception can be set via the message attribute +or character data nested into the element.

Parameters

@@ -41,6 +43,9 @@ BUILD FAILED build.xml:4: Something wrong here. +
  <fail>Something wrong here.</fail>
+

will give the same result as above.

+

Copyright © 2000,2001 Apache Software Foundation. All rights Reserved.

diff --git a/src/main/org/apache/tools/ant/taskdefs/Exit.java b/src/main/org/apache/tools/ant/taskdefs/Exit.java index 113f0fe90..e707db6ca 100644 --- a/src/main/org/apache/tools/ant/taskdefs/Exit.java +++ b/src/main/org/apache/tools/ant/taskdefs/Exit.java @@ -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()); + } + }