Community
Participate
Working Groups
Hi! >If I start the script using "-logger org.apache.tools.ant.XmlLogger" the >following output is generated. It seems the logger is working but I'm >wondering about the exception. It seems that the Eclipse AntRunner is >invoking something when the build is finished ?!? I found the bug!!!! The problem is InternalAntRunner around line 564. In the current code (build 20030115) the build is finished and then a message is loged. But if you finish a build, the XmlLogger throws away some vars (buildElement). I don't know Ant but I think this is the root element. ------------ fireBuildFinished(getCurrentProject(), error); if (error == null && scriptExecuted) { logMessage(getCurrentProject(), getTimeString(System.currentTimeMillis() - startTime), Project.MSG_INFO); } ------------ A possible solution might be to fire the "build finished" event after doing the last log entry!!! ------------ if (error == null && scriptExecuted) { logMessage(getCurrentProject(), getTimeString(System.currentTimeMillis() - startTime), Project.MSG_INFO); } fireBuildFinished(getCurrentProject(), error); ------------ Cu, Gunnar
I love bug reports where the reporter has taken the time to look closely at the problem...thanks!
Darin, there are more problems. I tried running the patched version but the generated XML log is always empty. I think it is not filled correctly. Any ideas? I'd like to help because we really need the ant build output as XML.
The internal ant runner is closing the err and out streams too soon. In the finally block of run(List) you need to move the fireBuildFinished after the closing of err and out. The XmlLogger doesn't write anything to disk until build finished.
Thanks. Do you think it will be fixed in next builds?
It is already fixed in HEAD...so yes. Thanks for your help. If you need it before then you should be able to pull from CVS the two jars that changed and put them into your install plugin directory (make a backup of the old ones first :-) ) org.eclipse.ant.core\lib (antsupportlib.jar) and org.eclipse.ui.externaltools\lib (antrunner.jar). It should work (worth a try anyways).
Changes to InternalAntRunner to close the streams for the user specified log streams after build finished. moved the "time" messaging into AntProcessBuildLogger where it belonged. Otherwise other loggers, such as the XmlLogger would be reporting the time twice. Change the AntProcessBuildLogger to lazily retrieved the ant process. It was relying on a build started message before it would log any other messages. This was incorrect. Reworked dealing with -projecthelp to make it more like the commandline ant (just for fun)
Please verify (Jared and / or Gunnar if you are so inclined :-) )
Verified code. Gunnar, please let us know whether or not your test case is working for you in the next build.
My testcase works ok now using the latest libs (antsupportlib.jar and antrunner.jar) from CVS HEAD.