ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rubun Tang <rt...@algorithmics.com>
Subject Problems using Script task and XmlLogger together
Date Mon, 04 Feb 2002 15:46:45 GMT
Hi,

I'm having trouble using the script task under the XmlLogger listener. 
Let say I have the following build.xml:

<project name="tmp" default="script" basedir=".">
	<target name="script">
		<script language="javascript"> 
			<![CDATA[
      		for (i=1; i<=10; i++) {
        		echo = tmp.createTask("echo");
        		script.addTask(echo);
        		echo.setMessage(i*i);
      		}
			]]> 
		</script>
	</target>
</project>

if I run this with the default listener, everything goes fine.
However, if I go "ant -listener org.apache.tools.ant.XmlLogger", I will get
the following error. 

$ ant -listener org.apache.tools.ant.XmlLogger
Buildfile: build.xml

script:
     [echo] 1

BUILD FAILED

java.lang.RuntimeException: Mismatch - popped element = <task name="echo"
locati
on="" time="0 seconds"><message
priority="warn"><![CDATA[1]]></message></task> f
inished task element = <target name="script" time="0 seconds"><task
name="script
" location="c:\build.xml:4: " time="0 seconds"><message
priority="debug"><![CDAT
A[   +Task: echo]]></message><message priority="debug"><![CDATA[   +Task:
echo]]
></message><message priority="debug"><![CDATA[   +Task:
echo]]></message><messag
e priority="debug"><![CDATA[   +Task: echo]]></message><message
priority="debug"
><![CDATA[   +Task: echo]]></message><message priority="debug"><![CDATA[
+Task
: echo]]></message><message priority="debug"><![CDATA[   +Task:
echo]]></message
><message priority="debug"><![CDATA[   +Task: echo]]></message><message
priority
="debug"><![CDATA[   +Task: echo]]></message><message
priority="debug"><![CDATA[
   +Task: echo]]></message></task></target>
        at org.apache.tools.ant.XmlLogger.targetFinished(XmlLogger.java:182)
        at org.apache.tools.ant.Project.fireTargetFinished(Project.java:952)
        at org.apache.tools.ant.Target.performTasks(Target.java:206)
        at org.apache.tools.ant.Project.executeTarget(Project.java:601)
        at org.apache.tools.ant.Project.executeTargets(Project.java:560)
        at org.apache.tools.ant.Main.runBuild(Main.java:454)
        at org.apache.tools.ant.Main.start(Main.java:153)
        at org.apache.tools.ant.Main.main(Main.java:176)

Total time: 1 second
Mismatch - popped element = <task name="echo" location="" time="0
seconds"><mess
age priority="warn"><![CDATA[1]]></message></task> finished task element
=
<targ
et name="script" time="0 seconds"><task name="script"
location="c:\build.xml:4:
" time="0 seconds"><message priority="debug"><![CDATA[   +Task:
echo]]></message
><message priority="debug"><![CDATA[   +Task: echo]]></message><message
priority
="debug"><![CDATA[   +Task: echo]]></message><message
priority="debug"><![CDATA[
   +Task: echo]]></message><message priority="debug"><![CDATA[   +Task:
echo]]><
/message><message priority="debug"><![CDATA[   +Task:
echo]]></message><message
priority="debug"><![CDATA[   +Task: echo]]></message><message
priority="debug"><
![CDATA[   +Task: echo]]></message><message priority="debug"><![CDATA[
+Task:
echo]]></message><message priority="debug"><![CDATA[   +Task:
echo]]></message><
/task></target>

Is this a bug?

Thanks in advance.

Rubun


Mime
View raw message