简体   繁体   English

如何使用eclipse p2存储库获取具有平台特定代码的插件以部署到正确的平台?

[英]How do I get a plugin with platform specific code to deploy to the correct platform using an eclipse p2 repository?

I have an Eclipse Feature that I'm building that contains a few plugins. 我正在构建的Eclipse Feature包含一些插件。 One of the plugins uses the import package statement to declare a dependency on another plugin. 其中一个插件使用import package语句声明对另一个插件的依赖关系。

The other plugin has platform specific code and exists in another feature that I'm building. 另一个插件具有特定于平台的代码,并且存在于我正在构建的另一个功能中。 I have two plugins in this feature that have the platform specific code. 我在此功能中有两个具有平台特定代码的插件。 One for os=win32 arch=x86 and the other for os=win32 arch=x86_64 一个用于os = win32 arch = x86,另一个用于os = win32 arch = x86_64

Both features are being built and using Tycho and they both have p2 repositories that are successfully available. 这两个功能都在构建和使用Tycho中,并且都具有成功可用的p2存储库。

So, I made a composite repository that points to both of these repositories, and then I use the "Install New Software..." command in my RCP app and point to the composite repository to install the first feature I mentioned. 因此,我制作了一个复合存储库,指向这两个存储库,然后在RCP应用程序中使用“安装新软件...”命令,并指向复合存储库以安装我提到的第一个功能。

The issue is that when the installation is done, the plugin that has the platform specific code has failed to install correctly. 问题在于,安装完成后,具有平台特定代码的插件无法正确安装。 Specifically, the plugin for the x86 system shows up on my 64bit machine. 具体来说,x86系统的插件显示在我的64位计算机上。

In your feature.xml, choose the plugin with platform specific code and add a platform filter. 在feature.xml中,选择具有平台特定代码的插件,然后添加平台过滤器。 the filters are available on the right side (once you select the plugin). 过滤器位于右侧(一旦您选择了插件)。 You can choose filters such as: 您可以选择过滤器,例如:

  1. OS 操作系统
  2. WS WS
  3. Language 语言
  4. Architecture 建筑

When your feature is published, p2 will generate the appropriate filters. 发布功能后,p2将生成适当的过滤器。

I found the answer. 我找到了答案。

I needed a p2.inf file sitting next to my feature.xml file in the first feature I mentioned in the question. 我在问题中提到的第一个功能部件中,我的feature.xml文件旁边需要一个p2.inf文件。

And in that p2.inf file, I needed this text... 在那个p2.inf文件中,我需要这段文字...

requires.1.namespace=org.eclipse.equinox.p2.iu
requires.1.name=com.myplatform.specfic.bundle.win32.x86   
requires.1.filter=(&(osgi.os=win32) (osgi.arch=x86))

requires.1.namespace=org.eclipse.equinox.p2.iu
requires.1.name=com.myplatform.specfic.bundle.win32.x86_64
requires.1.filter=(&(osgi.os=win32) (osgi.arch=x86_64))

I added this file to the build.properties as well to make sure it was included in the deployed feature 我也将此文件添加到build.properties中,以确保已将其包含在已部署的功能中

Then when I deployed the p2 repository and performed the install into my RCP application, the correct plugin was placed onto my 64 bit machine. 然后,当我部署p2存储库并执行安装到RCP应用程序中时,正确的插件被放置到了我的64位计算机上。

UPDATE: I was wrong here. 更新:我在这里错了。 This is NOT the correct answer. 这不是正确的答案。 The incorrect plugin still gets installed on some machines. 不正确的插件仍会安装在某些计算机上。

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

相关问题 如何修复损坏的eclipse / HOME / .p2存储库? - How can I repair a damaged eclipse $HOME/.p2 repository? 使用Tycho,如何构建功能,其中包括我在p2存储库中构建和部署的其他功能 - Using Tycho, how do I build a Feature that includes other Features that I have built and deployed on my p2 repository Eclipse:使用P2目录安装Virgo工具插件 - Eclipse: Virgo tooling plugin installation using P2 directory 如何使用p2接触点指令在Eclipse插件安装期间解压缩存档 - How to unzip an archive during Eclipse plugin installation using p2 touchpoint instructions 特定于平台的依赖性蔓延到Eclipse插件中 - Platform-specific dependency creeping into Eclipse plugin Eclipse插件API:如何添加对特定平台插件的Javadoc支持? - Eclipse Plugin API: how can I add javadoc support for specific platform plugins? 如何通过p2存储库更新来更改eclipse.ini文件,使-vm看起来像另一个JRE? - How can I change eclipse.ini file via p2 repository update to make -vm to look another JRE? 如何安全地使用Eclipse p2配置文件? - How can I safely use an Eclipse p2 profile? 使用指向本地p2存储库的tycho构建本地eclipse插件 - Build local eclipse plugins using tycho pointing to local p2 repository 如何在Eclipse中获取平台插件的日志 - How to get the logs of platform plugins in eclipse
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM