ajdt.pdebuild.scripts not set during AJDT headless PDE build

218 views Asked by At

I have an eclipse rcp application being developed in eclipse 3.5. I am able to successfully execute pde headless build in ant (from command shell outside eclipse) via the following target entry:

<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>

But once AspectJ (AJDT) got involved, I modified the target above like so:

<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>

Unfortunately, I am now getting the following error:

c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml:8: Cannot find ${ajdt.pdebuild.scripts}/productBuild/allElements.xml imported from c:\eclipse-3.5\plugins\org.eclipse.ajdt.pde.build_2.0.2.e35x-release-20101021-0900\scripts\productBuild\productBuild.xml

does anyone have any idea on how to set the ajdt.pdebuild.scripts value? thank you!!!

2

There are 2 answers

12
Andrew Eisenberg On

See this blog post:

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

You should not be using AJDT-PDE. That is the old way of doing things and is no longer supported. Instead, you should be making changes to your build.properties file:

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

# optional
compilerArg=-aspectpath other.jar

Read the blog post for more details.

0
user1056027 On

there are several steps needed to wrangle ajdt-pde headless build to execute in eclipse 3.5:

1) add ajdt.pdebuild.scripts param with its respective value as a "jvmarg" to the above-shown "java" block.
2) in .../scripts/productBuild/productBuild.xml, change property name="allElementsFile" value="productBuild/allElements.xml" to this property name="allElementsFile" value="${ajdt.pdebuild.scripts}/productBuild/allElements.xml"
3) in .../scripts/productBuild/productBuild.xml, comment out import file="${ajdt.pdebuild.scripts}/productBuild/allElements.xml"
4) in .../scripts/productBuild/productBuild.xml, paste the following import statement: import file="${ajdt.pdebuild.scripts}/build.xml"