views:

587

answers:

3

I have a set of dependent projects in Eclipse, each with its own Ant build script. If I make a change in multiple projects, then select "Build All" (Ctrl+B), each Ant build is invoked in the correct order. But if there is an error in one project, Eclipse still tries to build the other projects also, and in the process clobbers the Ant console so that the build errors are no longer visible. This wouldn't be quite so annoying if I could open up the offending project and select "Build Project", but Eclipse out-smarts me: it won't rebuild until I open some file in the project, edit it, and save (typically I add and remove a space character wherever my cursor happens to be). An answer to any of the following questions would be welcome.

How can I configure Eclipse to (in preference order):

  1. terminate a "Build All" as soon as any project's Ant build fails?
  2. save all console output for "Build All" instead of resetting the console for each project?
  3. spawn a separate console for each new instance of Ant?
  4. allow me to force a "Build Project" even if it doesn't think anything has changed?

[UPDATE] Bonus Question:

  • How can I configure Eclipse so that fixing any build errors in a depended-on project counts as a "change" for the purposes of "Build Project"?
A: 

I am not too big on ant, but can't you make the builds dependent on one another?

javamonkey79
There are build dependencies between the projects.
Chris Conway
+1  A: 
javamonkey79
Using "foo.txt", I couldn't find the file afterward. But "${project_loc:PROJECT_NAME}/build.log" works. Unfortunately, the line numbers aren't clickable, as they are in the console.
Chris Conway
A: 

One alternative is to have each Ant build log itself, e.g., using the following in build.xml

<record name="build.log" 
        loglevel="verbose" 
        append="false" />

Oddly, Eclipse seems to disable this logging somehow when running an Ant build.

Chris Conway