1

I'm using Ant to invoke Eclipse PDE Build to make a headless build of an RCP application. As I understand it PDE Build itself calls Ant to build the application, so we're essentially running an Ant build in Ant.

The problem is this: when the PDE Build fails due to compilation errors from the Java compiler, the error is not propagated back to my parent Ant script that started the PDE Build. This means that the build is said to have been successful even though it wasn't. However it does fail properly when there are other errors, such as when a plugin is missing so that dependencies can't be resolved.

This is the task that I call to build an Eclipse feature:

<target name="feature_build">
    <exec executable="java" failonerror="true">
        <arg value="-Xmx512m" />
        <arg value="-jar" />
        <arg value="${equinox.launcher}" />
        <arg value="-application" />
        <arg value="org.eclipse.ant.core.antRunner" />
        <arg value="-buildfile" />
        <arg value="${pde.build.dir}/scripts/build.xml" />
    </exec>
</target>

Am I doing something obviously wrong, or could this be a bug in PDE Build? I'm building for Eclipse E4 M5, and according to the build output the version of PDE Build is 3.9.0-v20131003-1506.

tobier
  • 646
  • 1
  • 5
  • 21
  • I'm having the exact same issue, did you figure out why you were not getting notified there were compile errors? – M.S. Apr 28 '14 at 22:02
  • 2
    Nevermind, figured it out. You have to set the flag javacFailOnError=true in your build.properties file. The failonerror in your ant task you posted only applies to the exec you are calling so it's only looking at return code of that process. You need to have to flag in the build.properties to make it's ant task fail on error. Now I'm just trying to figure out why it won't auto build dependencies when I try and build a single plugin/feature (multiple features in my code repository) – M.S. Apr 29 '14 at 03:55
  • Seems like I already have javacFailonError=true in my build.properties. :/ – tobier Apr 29 '14 at 07:43

0 Answers0