Eclipse RCP:多平台部署

1 问题

  在使用Eclipse RCP IDE进行开发时,它自带的PDE(插件开发环境)工具仅能够导出相同平台的部署包,比如win32的仅能导出win32的,linux64仅能够导出linux64的。

  如果我在win64上进行开发,但是我想导出win32、linux64、linux32、mac64下能够运行的部署包呢?最笨的办法是分别下载这几个平台的Eclipse RCP IDE,然后再进行导出,这种方法操作起来非常繁琐。更好的办法是使用tycho。

2 测试环境

win8 x64

ubuntu 18 x64

tycho 1.4

3 tycho简介

  Tycho is focused on a Maven-centric, manifest-first approach to building Eclipse plug-ins, features, update sites, RCP applications and OSGi bundles. Tycho is a set of Maven plugins and extensions for building Eclipse plugins and OSGi bundles with Maven. Eclipse plugins and OSGi bundles have their own metadata for expressing dependencies, source folder locations, etc. that are normally found in a Maven POM. Tycho uses native metadata for Eclipse plugins and OSGi bundles and uses the POM to configure and drive the build. Tycho supports bundles, fragments, features, update site projects and RCP applications.

  简单地说,tycho是一个maven插件,可以用它来进行eclipse打包,可用于导出plugin,feature, product,update site等。

4 maven核心配置

  1 <properties>
  2     <tycho-version>1.4.0</tycho-version>
  3 </properties>
  4 
  5 <build>
  6 <plugins>
  7     <plugin>
  8         <groupId>org.eclipse.tycho</groupId>
  9         <artifactId>tycho-maven-plugin</artifactId>
 10         <version>${tycho-version}</version>
 11         <extensions>true</extensions>
 12     </plugin>
 13 
 14     <plugin>
 15         <groupId>org.eclipse.tycho</groupId>
 16         <artifactId>target-platform-configuration</artifactId>
 17         <version>${tycho-version}</version>
 18         <configuration>
 19             <environments>
 20                 <environment>
 21                     <os>win32</os>
 22                     <ws>win32</ws>
 23                     <arch>x86</arch>
 24                 </environment>
 25                 <environment>
 26                     <os>win32</os>
 27                     <ws>win32</ws>
 28                     <arch>x86_64</arch>
 29                 </environment>
 30                 <environment>
 31                     <os>linux</os>
 32                     <ws>gtk</ws>
 33                     <arch>x86_64</arch>
 34                 </environment>
 35                 <environment>
 36                     <os>linux</os>
 37                     <ws>gtk</ws>
 38                     <arch>x86_64</arch>
 39                 </environment>
 40                 <environment>
 41                     <os>macosx</os>
 42                     <ws>cocoa</ws>
 43                     <arch>x86_64</arch>
 44                 </environment>
 45             </environments>
 46         </configuration>
 47     </plugin>
 48 </plugins>
 49 </build>
 50 

5 参考

http://www.eclipse.org/tycho/

 

你的点赞与分享是对我最大的支持

posted @ 2020-08-03 18:24  何德海  阅读(569)  评论(0编辑  收藏  举报