diff options
-rw-r--r-- | src/java/net/sf/antcontrib/logic/ForTask.java | 9 | ||||
-rw-r--r-- | test/resources/logic/asserttest.xml | 8 |
2 files changed, 12 insertions, 5 deletions
diff --git a/src/java/net/sf/antcontrib/logic/ForTask.java b/src/java/net/sf/antcontrib/logic/ForTask.java index 516773b..59b8c09 100644 --- a/src/java/net/sf/antcontrib/logic/ForTask.java +++ b/src/java/net/sf/antcontrib/logic/ForTask.java @@ -226,9 +226,12 @@ public class ForTask extends Task { int taskCount = 0; // Create a macro attribute - MacroDef.Attribute attribute = new MacroDef.Attribute(); - attribute.setName(param); - macroDef.addConfiguredAttribute(attribute); + if (macroDef.getAttributes().isEmpty()) { + MacroDef.Attribute attribute = new MacroDef.Attribute(); + attribute.setName(param); + macroDef.addConfiguredAttribute(attribute); + } + // Take Care of the list attribute if (list != null) { StringTokenizer st = new StringTokenizer(list, delimiter); diff --git a/test/resources/logic/asserttest.xml b/test/resources/logic/asserttest.xml index 8502299..acce588 100644 --- a/test/resources/logic/asserttest.xml +++ b/test/resources/logic/asserttest.xml @@ -12,8 +12,12 @@ <target name="test1"> <property name="testprop" value="true"/> - <assert name="testprop"/> - <assert name="testprop" value="true"/> + <assert> + <isset property="testprop"/> + </assert> + <assert> + <istrue value="${testprop}" /> + </assert> </target> <target name="test2"> |