在 Eclipse 中禁用构建工作区进程

发布于 2024-08-26 11:37:01 字数 68 浏览 7 评论 0原文

当构建工作区进程运行时 Eclipse 在做什么?我可以禁用它吗,因为它需要很长时间才能完成,而且我不知道是否有必要。谢谢

What is Eclipse doing when building workspace process is running? Can i disable it because it is taking a long time to complete and i dont know if it is necessary. Thank you

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

千秋岁 2024-09-02 11:37:01

构建工作区是关于在当前使用的工作区中打开的项目之一中检测到的任何演变的增量构建。

您还可以通过菜单“自动项目/构建”禁用它。

但我建议首先检查:

  • 项目清理所有/构建是否会导致同样的长时间等待(禁用此选项后),
  • 如果您有(这次自动激活构建)一些验证选项,您可以禁用以查看它们是否 会对全局编译时间产生影响(Preferences / Validations,或 Preferences / XML / ... 如果安装了 WTP)
  • 如果引用相同工作空间的全新 Eclipse 安装, (请参阅此 eclipse.ini 了解更多)导致相同的问题(自动激活构建)

请注意 bug 329657(2011 年开放,2014 年进行中)是关于中断(太长的)构建,而不是取消它:

构建中断和取消之间有一个重要的区别。

  • 当构建被取消时,它通常通过丢弃增量构建状态并让下一个构建完全重建来处理此问题。在某些项目中这可能相当昂贵。
    作为用户,我认为我宁愿等待 5 秒增量构建完成,也不愿取消并导致之后 30 秒重建。

  • 中断的想法是,构建器可以通过保存中间状态并在下一次调用时恢复来更有效地处理中断。
    实际上,这很难实现,因此最常见的边界是我们在调用链中的每个构建器之前/之后检查中断的时间。

 

Building workspace is about incremental build of any evolution detected in one of the opened projects in the currently used workspace.

You can also disable it through the menu "Project / Build automatically".

But I would recommend first to check:

  • if a Project Clean all / Build result in the same kind of long wait (after disabling this option)
  • if you have (this time with building automatically activated) some validation options you could disable to see if they have an influence on the global compilation time (Preferences / Validations, or Preferences / XML / ... if you have WTP installed)
  • if a fresh eclipse installation referencing the same workspace (see this eclipse.ini for more) results in the same issue (with building automatically activated)

Note that bug 329657 (open in 2011, in progress in 2014) is about interrupting a (too lengthy) build, instead of cancelling it:

There is an important difference between build interrupt and cancel.

  • When a build is cancelled, it typically handles this by discarding incremental build state and letting the next build be a full rebuild. This can be quite expensive in some projects.
    As a user I think I would rather wait for the 5 second incremental build to finish rather than cancel and result in a 30 second rebuild afterwards.

  • The idea with interrupt is that a builder could more efficiently handle interrupt by saving its intermediate state and resuming on the next invocation.
    In practice this is hard to implement so the most common boundary is when we check for interrupt before/after calling each builder in the chain.

 

寂寞笑我太脆弱 2024-09-02 11:37:01

您可以切换到手动构建,以便控制何时完成。只需确保 Project >未选中主菜单中的自动构建

You can switch to manual build so can control when this is done. Just make sure that Project > Build Automatically from the main menu is unchecked.

暖伴 2024-09-02 11:37:01

如果需要通过 PDE 或 JDT 代码进行编程:

public static void setWorkspaceAutoBuild(boolean flag) throws CoreException 
{
IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IWorkspaceDescription description = workspace.getDescription();
description.setAutoBuilding(flag);
workspace.setDescription(description);
}

if needed programmatic from a PDE or JDT code:

public static void setWorkspaceAutoBuild(boolean flag) throws CoreException 
{
IWorkspace workspace = ResourcesPlugin.getWorkspace();
final IWorkspaceDescription description = workspace.getDescription();
description.setAutoBuilding(flag);
workspace.setDescription(description);
}
别在捏我脸啦 2024-09-02 11:37:01

对于遇到未选中自动构建但项目仍在构建的问题的任何人。确保您的项目没有部署到服务器选项卡中的服务器并被告知保持同步。

For anyone running into a problem where build automatically is unchecked but the project is still building. Make sure your project isn't deployed to the server in the server tab and told to stay synchronous.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文