使用Tycho为多种环境构建单一产品

时间:2014-06-10 14:24:07

标签: eclipse-plugin eclipse-rcp tycho p2

如何创建具有合并环境依赖关系的独立于平台的产品?

当使用带有eclipse-application打包类型的Tycho 0.19.0时,tycho-packaging-plugin的{​​{3}}参数可用于防止为每个平台创建多个产品分发(生成单个,通用的分发)

 <packaging>eclipse-application</packaging>
 <build>
   <plugins>
     <plugin>
       <groupId>${tycho-groupid}</groupId>
       <artifactId>tycho-packaging-plugin</artifactId>
       <version>${tycho-version}</version>
       <configuration>
         <separateEnvironments>false</separateEnvironments>
       </configuration>
     </plugin>
   </plugins>
 </build>

但第谷警告说:

[INFO] --- tycho-packaging-plugin:0.19.0:product-export (default) @ q7runner ---
[WARNING] The packaging type 'eclipse-application' is deprecated; use 'eclipse-repository' instead. See http://wiki.eclipse.org/Tycho_Messages_Explained#Eclipse_Application

当我尝试直接使用tycho-packaging时会出现相同的警告。

使用eclipse-repository打包类型并直接调用tycho-p2-director插件separateEnvironments似乎无效:

<packaging>eclipse-repository</packaging>
<plugin>
  <groupId>${tycho-groupid}</groupId>
  <artifactId>tycho-p2-director-plugin</artifactId>
  <version>${tycho-version}</version>
  <executions>
    <execution>
      <id>create-distributions</id>
      <goals>
        <goal>materialize-products</goal>
        <goal>archive-products</goal>
      </goals>
    </execution>
  </executions>
  <configuration>
    <separateEnvironments>false</separateEnvironments>
  </configuration>
</plugin>
..................
[INFO] --- tycho-p2-director-plugin:0.19.0:materialize-products (create-distributions) @ q7runner ---
[INFO] Installing product com.xored.q7.q7runner for environment win32/win32/x86 to C:\Users\vasili\git\q7\runner\product\target\products\com.xored.q7.q7run
ner\win32\win32\x86
Installing com.xored.q7.q7runner 1.3.12.201406101420.
Operation completed in 35268 ms.
[INFO] Installing product com.xored.q7.q7runner for environment win32/win32/x86_64 to C:\Users\vasili\git\q7\runner\product\target\products\com.xored.q7.q7
runner\win32\win32\x86_64

1 个答案:

答案 0 :(得分:0)

tycho-p2-director-plugin将产品安装的创建委托给p2 director,以便可以使用p2更新生成的安装。 (这是您无法通过eclipse-application创建的安装所做的事情)。不幸的是,p2 director doesn't have support for multi-environment installations,以及Tycho的eclipse-repository也没有。{/ p>