Community
Participate
Working Groups
Currently it is complex to determine if an Ant task has been canceled, and internals are needed. I find the UIBuildListener in the list of buildlisteners of an ant project, and use fBuildListener.taskFinished(null) to check if the cancel button has been pressed. The classes UIBuildListener and BuildCanceledException are internal, so this is not a proper way to check the cancel button when running an Ant task. My request is: could UIBuildlistener be made 'public', and maybe a more Eclipse-like way of checking for canceled could be provided. NOTES: KH (6/13/2001 8:14:51 AM) Moving to Core JM (6/13/2001 11:59:18 AM) Defer. This is a good idea.
PRODUCT VERSION: Eclipse SDK 0.119
In Eclipse 2.0 (build 20020307), this workaround causes an NPE. I see no way in Eclipse 2.0 to check if a task is canceled by the user. This is unacceptable in our plugin because we run a long task.
It seems Ant Core provided this functionality. Will investigate.
Should look at bug 3103 when fixing this one.
If calling AntRunner.run(IProgressMonitor monitor), the monitor will be available for the current task as an object reference. Just use Task.getProject ().getReferences().get("eclipse.progress.monitor") to get the reference to the IProgressMonitor. Fixed and released.
20020528 This fix seems to have been lost somewhere. In my Ant tasks execute() method, getProject().getReferences() has only one entry. Its key is the name of the Ant project in which a target is executed, its value is the Project object. This is the case both when Ant task execution is triggered form the context menu or from Run -> External Tools -> ... Where is the code that adds the "eclipse.progress.monitor" entry?
I was going to send you a message about it but was waiting the code in the UI to change (the current code does not pass a progress monitor to the AntRunner - see bug 17481). The changes will probably be included in today's (20020529) integration build.
20020530: Verified