如何使用Indigo设置Eclipse PDE / Build?

时间:2011-09-20 11:57:08

标签: eclipse build-automation eclipse-pde eclipse-indigo

在我的项目中,我使用PDE / Build在Hudson的远程服务器上构建我的RCP应用程序。 当前版本是基于Eclipse Galileo的软件包,它既可以作为构建器应用程序,也可以作为目标平台。

现在我想把它升级到Indigo,我需要一些帮助。

首先,解压缩拉链数以形成目标平台的旧方法不起作用。 (我使用了Platform Runtime Binary,Delta pack,PDE Runtime Binary和JDT Runtime Binary - 我提出的一个可以用作构建器和目标平台的集合)。

好的,有新的目标定义。 如何配置它以使其与我的Galileo设置相对应? (当然,我不介意它是否更简单/更清洁)。

我尝试了以下内容:

  1. 从download.eclipse.org/eclipse/updates/3.7
  2. 添加了Eclipse RCP,Eclipse RCP插件开发人员资源(来源),PDE / API工具环境
  3. 从download.eclipse.org/releases/indigo
  4. 添加了Eclipse Java Development
  5. 从download.eclipse.org/eclipse/downloads/drops/R-3.7-201106131736/download.php?dropFile=eclipse-3.7-delta-pack.zip手动下载delta包,解压缩并添加生成的目录(作为目录)到目标定义。 顺便说一句,是否有Indigo delta pack的更新站点?
  6. 从Eclipse Orbit p2网站添加了几个第三方插件:download.eclipse.org/tools/orbit/downloads/drops/R20110523182458/repository
  7. 然后我使用了定义的'Set as Target Platform' - 我的项目在我的工作区中构建得很好 - 这很好! 然后我将平台导出到。 现在,如果我尝试执行这样的构建:

    java -jar <target-platform>\plugins\org.eclipse.equinox.launcher_1.2.0.v20110502.jar -application org.eclipse.ant.core.antRunner -buildfile <target-platform>/plugins/org.eclipse.pde.build_3.7.0.v20110512-1320/scripts/productBuild/productBuild.xml -Dbuilder=<pdebuild-folder>
    

    甚至

    java -jar <target-platform>\plugins\org.eclipse.equinox.launcher_1.2.0.v20110502.jar
    

    我收到以下错误:

      

    发生了错误。请参阅日志文件\ configuration \ 1316517334675.log

    该日志包含以下内容:

      

    !会话2011-09-20 15:15:34.269   eclipse.buildId =未知   java.version = 1.7.0   java.vendor = Oracle Corporation   BootLoader常量:OS = win32,ARCH = x86,WS = win32,NL = en_US

         

    !ENTRY org.eclipse.osgi 4 0 2011-09-20 15:15:35.175   !MESSAGE应用程序错误   !堆栈1   java.lang.IllegalStateException:无法获取应用程序服务。确保已解析并启动org.eclipse.core.runtime软件包(请参阅config.ini)。     在org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:74)     在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:344)     在org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:179)     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)     at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)     at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)     at java.lang.reflect.Method.invoke(Unknown Source)     在org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:622)     在org.eclipse.equinox.launcher.Main.basicRun(Main.java:577)     在org.eclipse.equinox.launcher.Main.run(Main.java:1410)     在org.eclipse.equinox.launcher.Main.main(Main.java:1386)

1 个答案:

答案 0 :(得分:1)

结束了基于Maven的构建,针对“Eclipse for RCP和RAP Developers”以及delta pack plus SWTBot。 两者都部署到我的Maven存储库,并在构建期间解压缩(如果需要)。因此,我不再关心目标平台的大小。

<build>

    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-dependency-plugin</artifactId>
            <version>2.4</version>
            <executions>
                <!-- Deploy target platform if required -->
                <execution>
                    <id>unpack-target-platform</id>
                    <phase>initialize</phase>
                    <goals>
                        <goal>unpack</goal>
                    </goals>

                    <configuration>
                        <markersDirectory>${target.platform.dir}</markersDirectory>
                        <artifactItems>
                            <artifactItem>
                                <groupId>org.eclipse</groupId>
                                <artifactId>rcp-target-platform</artifactId>
                                <version>3.7.2-win32-x86_64</version>
                                <type>zip</type>
                                <outputDirectory>${target.platform.dir.sdk}</outputDirectory>
                            </artifactItem>

                            <artifactItem>
                                <groupId>org.eclipse</groupId>
                                <artifactId>rcp-target-platform-delta-pack</artifactId>
                                <version>3.7.2</version>
                                <type>zip</type>
                                <outputDirectory>${target.platform.dir.deltapack}</outputDirectory>
                            </artifactItem>

                            <artifactItem>
                                <groupId>org.eclipse</groupId>
                                <artifactId>swtbot.eclipse</artifactId>
                                <version>2.0.5.20111003_1754-3676ac8-dev-e36</version>
                                <type>zip</type>
                                <outputDirectory>${target.platform.dir.swtbot}</outputDirectory>
                            </artifactItem>
                        </artifactItems>
                    </configuration>
                </execution>

            </executions>

        </plugin>
    </plugins>
</build>



<properties>
    <!-- Build system properties -->
    <target.platform.dir>/rcp-target-platform-3.7.2</target.platform.dir>

    <target.platform.dir.swtbot>${target.platform.dir}/swtbot</target.platform.dir.swtbot>
    <target.platform.dir.swtbot.plugins>${target.platform.dir.swtbot}/eclipse/plugins</target.platform.dir.swtbot.plugins>

    <target.platform.dir.sdk>${target.platform.dir}/sdk</target.platform.dir.sdk>
    <target.platform.dir.sdk.plugins>${target.platform.dir.sdk}/eclipse/plugins</target.platform.dir.sdk.plugins>

    <target.platform.dir.deltapack>${target.platform.dir}/deltapack</target.platform.dir.deltapack>
    <target.platform.dir.deltapack.plugins>${target.platform.dir.deltapack}/eclipse/plugins</target.platform.dir.deltapack.plugins>

    <pdebuild.launcherVersion>1.2.0.v20110502</pdebuild.launcherVersion>
    <pdebuild.plugin.version>3.7.0.v20111116-2009</pdebuild.plugin.version>

    <pdebuild.antDelegateBuildfile>${pdebuild.configDirectory}/pdebuild-ant-from-mvn.xml</pdebuild.antDelegateBuildfile>
    <pdebuild.configDirectory>${basedir}/pdebuild</pdebuild.configDirectory>

    <pdebuild.buildDirectory>${project.build.directory}/${pdebuild.directory}</pdebuild.buildDirectory>
    <pdebuild.directory>pde-build</pdebuild.directory>
</properties>

然后我从Maven中调用ant build:

        <!-- Delegate execution to PDE/Build via ant -->
        <plugin>
            <artifactId>maven-antrun-plugin</artifactId>
            <version>1.7</version>
            <executions>
                <execution>
                    <phase>compile</phase>
                    <configuration>
                        <target>
                            <ant antfile="${pdebuild.antDelegateBuildfile}">
                                <property name="equinoxLauncherPluginVersion" value="${pdebuild.launcherVersion}" />
                                <property name="pdeBuildPluginVersion" value="${pdebuild.plugin.version}" />
                                <property name="projectsDirectory" value="${basedir}" />
                                <property name="baseLocation" value="${target.platform.dir}" />
                                <property name="buildDirectory" value="${pdebuild.buildDirectory}" />
                                <property name="builder" value="${pdebuild.configDirectory}" />
                                <property name="product" value="${gui.product}"/>
                                <property name="runPackager" value="${pdebuild.runPackager}"/>
                            </ant>
                        </target>
                    </configuration>
                    <goals>
                        <goal>run</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

我对现在的设置很满意。