Ant build consoles get clobbered by dependent proj

2019-08-02 19:16发布

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

3条回答
beautiful°
2楼-- · 2019-08-02 19:40

Have you tried redirecting standard out to file via a run configuration? A few screen shots to help if not... (you may try 'append' this is not in my screen shot :) )

run config for ant

Common tag and std io

查看更多
虎瘦雄心在
3楼-- · 2019-08-02 19:42

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

查看更多
Juvenile、少年°
4楼-- · 2019-08-02 19:46

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.

查看更多
登录 后发表回答