简体   繁体   English

防止Eclipse添加所需的插件以添加片段

[英]Prevent Eclipse Add required plug-ins from adding fragments

I am working on RCP application which contains plug-ins(functionality) and fragments(tests) in Eclipse Luna. 我正在研究RCP应用程序,它包含Eclipse Luna中的插件(功能)和片段(测试)。 "Add required plug-in" adds plug-in with all its fragments even if fragment isn't necessary. “添加所需的插件”会添加插件及其所有片段,即使片段不是必需的。 How can I force eclipse to make absolute minimum with "add required plug-ins" action? 如何通过“添加必需的插件”操作强制eclipse达到绝对最小值? (just adding plug-in without fragment) (只是添加没有片段的插件)

Here is snippet of my Manifest: 这是我的清单的片段:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: My Plugin
Bundle-SymbolicName: com.something.myplugin;singleton:=true
Bundle-Version: 1.0.0
Bundle-Vendor: XYZ
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Eclipse-ExtensibleAPI: true
Require-Bundle:...
Export-Package:...

If dependencies are marked as "optional" you can uncheck the box "include optional dependencies when computing required plugins" to avoid including them. 如果依赖项被标记为“可选”,则可以取消选中“在计算所需插件时包含可选依赖项”框以避免包含它们。

Otherwise my workaround approach is to select appropriate plugins by hand (usually by deselecting them after "select required" action) then save the "run configuration" and share it on the source versioning system for reuse. 否则,我的解决方法是手动选择适当的插件(通常在“select required”操作后取消选择)然后保存“运行配置”并在源版本控制系统上共享以便重复使用。 Unfortunately this is not very resistant to platform changes, eg fragments appropriate for linux64 are not the same as win64 in my fragment examples. 不幸的是,这对平台更改不是很有抵抗力,例如,适用于linux64的片段与我的片段示例中的win64不同。 So name the configurations appropriately. 因此,适当地命名配置。

For tests, I've had some success automating deployment of eclipse + install of specific features using command-line, where with some scripting you can control the plugins and versions you are using with more ease than using the click-click gui. 对于测试,我已经成功地使用命令行自动部署eclipse +安装特定功能,在某些脚本中,您可以比使用click-click gui更轻松地控制所使用的插件和版本。

Again this allows to build and store eclipse configurations in some reusable form. 同样,这允许以某种可重用的形式构建和存储eclipse配置。 Debug is accomplished by checking out the projects you are debugging in the eclipse built from command line, then running a vanilla debug instance "all platform and workspace plugins". 通过在命令行构建的eclipse中检出您正在调试的项目,然后运行一个vanilla调试实例“所有平台和工作区插件”来完成调试。 You do need JDT+debug components though, so for RCP I'm not sure how that would work. 你确实需要JDT +调试组件,所以对于RCP,我不确定它是如何工作的。

Fragments are a pain, in my experience, consider using features if you can, the ui and p2 system deal with it much better. 碎片是一种痛苦,根据我的经验,如果可以的话,考虑使用功能,ui和p2系统可以更好地处理它。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM