From 79901525e8b47dea53cdc5cf28765ea842a6f011 Mon Sep 17 00:00:00 2001 From: Matthew Jason Benson Date: Thu, 10 May 2007 22:30:36 +0000 Subject: [PATCH] striplinecomments comment nested text value git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@537021 13f79535-47bb-0310-9956-ffa450edef68 --- WHATSNEW | 4 ++ .../tools/ant/filters/StripLineComments.java | 10 ++++ .../filters/striplinecomments-test.xml | 58 +++++++++++++++++++ 3 files changed, 72 insertions(+) create mode 100644 src/tests/antunit/filters/striplinecomments-test.xml diff --git a/WHATSNEW b/WHATSNEW index 85b0cd29c..d506d0549 100644 --- a/WHATSNEW +++ b/WHATSNEW @@ -128,6 +128,10 @@ Other changes: * is now usable as a single-element ResourceCollection. +* It is now possible to provide the value of a filter's + nested element as nested text instead of using the 'value' + attribute. + Changes from Ant 1.6.5 to Ant 1.7.0 =================================== diff --git a/src/main/org/apache/tools/ant/filters/StripLineComments.java b/src/main/org/apache/tools/ant/filters/StripLineComments.java index d9bd97df5..84ac8904f 100644 --- a/src/main/org/apache/tools/ant/filters/StripLineComments.java +++ b/src/main/org/apache/tools/ant/filters/StripLineComments.java @@ -219,5 +219,15 @@ public final class StripLineComments public final String getValue() { return value; } + + /** + * Alt. syntax to set the prefix for this type of line comment. + * + * @param comment The prefix for a line comment of this type. + * Must not be null. + */ + public void addText(String comment) { + setValue(comment); + } } } diff --git a/src/tests/antunit/filters/striplinecomments-test.xml b/src/tests/antunit/filters/striplinecomments-test.xml new file mode 100644 index 000000000..a1cafee6f --- /dev/null +++ b/src/tests/antunit/filters/striplinecomments-test.xml @@ -0,0 +1,58 @@ + + + + + + foo +#pound +bar +//java sl +baz +REMark + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + # + // + REM + + + +