Eclipse PDE:如何以编程方式检测自动构建过程

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

在我的插件中,我需要以编程方式查明 IDE workbench 是否有构建过程 运行ning。如果是,则插件必须等待该过程完成才能进入下一步。如果在 Eclipse IDE 上设置了自动构建,是否有任何方法可以通过编程方式检测此类构建过程何时开始 运行?谢谢

您可以使用作业管理器等待构建完成:

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);