Bug 40556 - build progress and cancelling problems
Summary: build progress and cancelling problems
Status: RESOLVED FIXED
Alias: None
Product: AJDT
Classification: Tools
Component: UI (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows XP
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Adrian Colyer CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-07-21 10:23 EDT by Mik Kersten CLA
Modified: 2003-11-11 11:32 EST (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mik Kersten CLA 2003-07-21 10:23:17 EDT
After the first build the progress monitor bar is always at 100%.

Build cancelling does not work.
Comment 1 George Harley CLA 2003-11-02 16:48:29 EST
Problem #1 (progress monitor always 100%)
-----------------------------------------
This problem only occurs if a build is carried out with the default build 
configuration file. With a user-specified build config file the progress monitor 
bar moves smoothly left to right. 
Cause of this is a call to IResource::refreshLocal() in the writeBuildConfig() 
method of org.eclipse.ajdt.internal.builder.Builder that incorrectly passes in 
the IProgressMonitor for the build. Instead of passing in the build monitor, 
*should* be passing in a null (to signify we don't want any monitoring of the 
refresh task). The writeBuildConfig() method only gets called when building with 
the default build config file. 
Patch emailed separately to Andy Clement.

Problem #2 (cancel button doesn't work)
---------------------------------------
Looks like we do not check the IProgressMonitor to see if it is in the cancel 
state. Suggest we poll the build monitor from inside the while loop of the 
waitForBuildCompletion() method in org.eclipse.ajdt.internal.builder.Builder. 
That is, call the IProgressMonitor::isCanceled() operation on the build monitor 
and, if it returns true, throw a org.eclipse.core.runtime.
OperationCanceledException exception. At a first pass, we can catch this 
exception in the org.eclipse.ajdt.internal.builder.Builder's build() method and 
log the fact that the build has been cancelled. Is there anything that we need 
to add into this catch block ?
Patch emailed separately to Andy Clement.

Comment 2 George Harley CLA 2003-11-03 05:57:04 EST
Andy and I have discussed the "build cancel" side of this bug report and agreed 
that my patch only goes so far in remedying the situation : throwing and 
catching the OperationCancelledException will kill the build progress dialogue 
but the compiler still will still keep rumbling on in the background until it 
has finished its work. It looks like what is required here is a means of 
notifying the compiler that the build should be terminated. The abortBuild() 
method of org.aspectj.ajde.internal.AspectJBuildManager looks like it *ought* to 
be the desired mechanism. Mik, can you confirm that calling this is what is 
required ? Plus, are there any other "clean up" calls that need to be made 
following on from this call ? 
Comment 3 Adrian Colyer CLA 2003-11-11 11:32:56 EST
The AJDT side of this is now as complete as can be until AspectJ supports the 
cancellation of a running build. Thanks to George for the patch.