【问题标题】:ajdt.pdebuild.scripts not set during AJDT headless PDE build在 AJDT 无头 PDE 构建期间未设置 ajdt.pdebuild.scripts
【发布时间】:2011-12-03 10:37:38
【问题描述】:

我有一个在 eclipse 3.5 中开发的 eclipse rcp 应用程序。我能够通过以下目标条目在 ant 中成功执行 pde headless build(来自 eclipse 外部的命令 shell):

<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从 c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\ 导入的 .pdebuild.scripts}/productBuild/allElements.xml productBuild.xml

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

【问题讨论】:

    标签: aspectj pde headless ajdt


    【解决方案1】:

    查看这篇博文:

    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
    

    阅读博文了解更多详情。

    【讨论】:

    • 感谢您的回复,安德鲁。我已经通读了同一篇文章。不幸的是,您所说的新方法适用于 eclipse 3.6 及更高版本。按照我最初的帖子中的说明,我正在运行 3.5。
    • ...由于我们当前的版本被锁定到 3.5,我无法升级到 3.6。
    • 不要将目标环境与构建环境混淆。仅仅因为您需要以 Eclipse 为目标,并不意味着您不能使用 Eclipse 3.6 或 3.7 进行构建。
    • 但也许更重要的问题是……为什么你还被锁定在 3.5 中?
    • Andrew,我不打算讨论为什么我们被锁定在 3.5 中。我们只是,我对此无能为力。我确信在 3.6 之前执行了 3.5 ajdt pde 无头构建,我只是想知道如何。具体来说,为什么没有设置上述属性。
    【解决方案2】:

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

    1) 将 ajdt.pdebuild.scripts 参数及其各自的值作为“jvmarg”添加到上面显示的“java”块中。
    2) 在 .../scripts/productBuild/productBuild.xml 中,将 property name="allElementsFile" value="productBuild/allElements.xml" 更改为此 属性名称="allElementsFile" 值="${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.xml"强>

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-01-14
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2010-11-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多