CMZS
CMZS

Reputation: 601

Eclipse PDE: How to programmatically detect the auto-build process

In my plugin, I need to programmatically find out whether the IDE workbench has a build process running. If yes then the plugin has to wait for the process to complete before moving to the next step. If Auto Build is set on Eclipse IDE, is there any way to programmatically detect when such a build process starts to run? Thanks

Upvotes: 2

Views: 347

Answers (1)

greg-449
greg-449

Reputation: 111142

You can wait for builds to finish using the Job Manager:

IJobManager jobManager = Job.getJobManager();

// Wait for manual build to finish if running
jobManager.join(ResourcesPlugin.FAMILY_MANUAL_BUILD, progressMonitor);

// Wait for auto build to finish if running
jobManager.join(ResourcesPlugin.FAMILY_AUTO_BUILD, progressMonitor);

Upvotes: 3

Related Questions