在 Eclipse 中禁用构建工作区过程
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2505229/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Disable building workspace process in Eclipse
提问by Super Cat
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
构建工作区进程正在运行时 Eclipse 在做什么?我可以禁用它,因为它需要很长时间才能完成,我不知道是否有必要。谢谢
回答by VonC
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
".
您也可以通过菜单“ 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
, orPreferences / XML / ...
if you have WTP installed) - if a fresh eclipse installation referencing the same workspace (see this eclipse.inifor more) results in the same issue (with building automatically activated)
- 如果 Project Clean all / Build 导致同样的长时间等待(禁用此选项后)
- 如果您有(这次自动激活构建)一些验证选项,您可以禁用它们以查看它们是否对全局编译时间有影响(
Preferences / Validations
或者Preferences / XML / ...
如果您安装了 WTP) - 如果引用相同工作区的全新 Eclipse 安装(有关更多信息,请参阅此 eclipse.ini)导致相同问题(自动激活构建)
Note that bug 329657(open in 2011, in progress in 2014) is about interruptinga (too lengthy) build, instead of cancellingit:
请注意,错误 329657(2011 年开放,2014 年进行中)是关于中断(太长)构建,而不是取消它:
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.
构建中断和取消之间有一个重要的区别。
当一个构建被取消时,它通常通过丢弃增量构建状态并让下一个构建成为完全重建来处理这个问题。在某些项目中,这可能非常昂贵。
作为用户,我想我宁愿等待 5 秒增量构建完成而不是取消并导致 30 秒之后的重建。中断的想法是,构建器可以通过保存其中间状态并在下一次调用时恢复来更有效地处理中断。
实际上,这很难实现,因此最常见的边界是我们在调用链中的每个构建器之前/之后检查中断。
回答by Chry Cheng
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.
您可以切换到手动构建,以便控制何时完成。只需确保Project > Build Automatically
从主菜单中取消选中。
回答by taitelman
if needed programmatic from a PDE or JDT code:
如果需要从 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);
}
回答by tw0shoes
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.
对于遇到未选中自动构建但项目仍在构建中的问题的任何人。确保您的项目未部署到服务器选项卡中的服务器并被告知保持同步。