Reputation: 102773
How can I write a plugin or program routine that gets notified when "build workspace" finishes in Eclipse?
Is IProgressMonitor useful for this? If so, how do I get ahold of it?
Upvotes: 6
Views: 630
Reputation: 8178
If you really want to receive a notification (rather than blocking), try this:
IWorkspace.addResourceChangeListener(myListener, IResourceChangeEvent.POST_BUILD);
The Javadoc of IResourceChangeEvent gives more details on usage and on information found in the event instance.
Upvotes: 4
Reputation: 111142
You can wait for the automatic build to finish using:
Platform.getJobManager().join(ResourcesPlugin.FAMILY_AUTO_BUILD, null);
This will block until the builds have finished (and do nothing if the build is not running).
You would probably also want to wait on the manual builds are well:
Platform.getJobManager().join(ResourcesPlugin.FAMILY_MANUAL_BUILD, null);
Upvotes: 4