0

我在 eclipse 3.5 中开发了一个 eclipse rcp 应用程序。我能够通过以下目标条目在 ant 中成功执行 pde 无头构建(从 eclipse 外部的命令外壳):

<target name="compile">
    <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true" dir="some-dir">
        <arg value="-application" />
        <arg value="org.eclipse.ant.core.antRunner" />
        <arg value="-buildfile" />
        <arg value="${eclipse.location}/plugins/org.eclipse.pde.build_${some-version}/scripts/productBuild/productBuild.xml" />
        <arg value="-Dtimestamp=${timestamp}" />
        <arg value="-propertyfile" />
        <arg value="${some-dir}/ant.properties" />
        <classpath>
            <pathelement
                 location="${eclipse.location}/plugins/org.eclipse.equinox.launcher_${some-version}.jar" />
        </classpath>
    </java>
</target>

但是一旦 AspectJ (AJDT) 参与进来,我就修改了上面的目标,如下所示:

<target name="compile">
    <java classname="org.eclipse.equinox.launcher.Main" fork="true" failonerror="true" dir="${some-dir}">
        <arg value="-application" />
        <arg value="org.eclipse.ant.core.antRunner" />
        <arg value="-buildfile" />      
        **<arg value="${eclipse.location}/plugins/org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900/scripts/productBuild/productBuild.xml" />**
        <arg value="-Dtimestamp=${timestamp}" />
        <arg value="-propertyfile" />
        <arg value="${some-dir}/ant.properties" />
        **<jvmarg value="-Dajdt.pdebuild.home=${eclipse.location}/plugins/org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900" />**            
        <classpath>
            <pathelement
                          location="${eclipse.location}/plugins/org.eclipse.equinox.launcher_${some-version}.jar" />
        </classpath>
    </java>
</target>

不幸的是,我现在收到以下错误:

c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml:8:找不到 ${ajdt.pdebuild.scripts} /从 c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml 导入的 productBuild/allElements.xml

有人知道如何设置 ajdt.pdebuild.scripts 值吗?谢谢你!!!

4

2 回答 2

0

要在 Eclipse 3.5 中执行 ajdt-pde 无头构建需要几个步骤:

1) 将ajdt.pdebuild.scripts参数及其各自的值作为“jvmarg”添加到上面显示的“java”块中。
2) 在.../scripts/productBuild/productBuild.xml中,将属性名称="allElementsFile" value="productBuild/allElements.xml"更改为此属性名称="allElementsFile" value="${ajdt.pdebuild.scripts} /productBuild/allElements.xml"
3) 在.../scripts/productBuild/productBuild.xml中,注释掉import file="${ajdt.pdebuild.scripts}/productBuild/allElements.xml"
4) 在.../ scripts/productBuild/productBuild.xml,粘贴以下导入语句:import file="${ajdt.pdebuild.scripts}/build.

于 2011-12-05T08:22:01.020 回答
0

请参阅此博客文章:

http://contraptionsforprogramming.blogspot.com/2010/03/ajdt-pde-builds-redux.html

您不应该使用 AJDT-PDE。那是旧的做事方式,不再受支持。相反,您应该对 build.properties 文件进行更改:

# required
compilerAdapter=org.eclipse.ajdt.core.ant.AJDT_AjcCompilerAdapter
sourceFileExtensions=*.java, *.aj

# optional
compilerArg=-aspectpath other.jar

阅读博文了解更多详情。

于 2011-12-03T15:50:15.393 回答