summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormattinger <[email protected]>2006-07-07 14:45:50 +0000
committermattinger <[email protected]>2006-07-07 14:45:50 +0000
commit855b913e7c3bf4b662beb1f97ac4980270330042 (patch)
tree13a61f284c559225f331a66c93a01102bd80bd0b
parente6cb208a20d77d388855ae517ec224cdc7480ae1 (diff)
Fixing assert stuff, and the For task
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/trunk/ant-contrib@8 32d7a393-a5a9-423c-abd3-5d954feb1f2f
-rw-r--r--src/java/net/sf/antcontrib/logic/ForTask.java9
-rw-r--r--test/resources/logic/asserttest.xml8
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">