ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <bi...@progress.com>
Subject Re: Multiple builds and failures
Date Thu, 21 Dec 2000 04:45:39 GMT
Hi Dave,

Ant doesn't have anything like make -k letting you continue despite
errors.

If you are really stuck and willing to hack the code a bit, the class
taskdefs/Ant.java which implements <antcall /> could be modified to take a
new attribute failonerror (like the exec task) where the default is true. 
When you don't want a failure in a called build.xml to stop the whole
build, you would set failonerror="false" like this:
    <antcall ... failonerror="false"/>
To implement this, add a new method setFailOnError to Ant.java (see
ExecTask.java) with a default true value.  Then modify the execute method
to catch BuildException.  If failonerror is true, rethrow the exception
else do nothing except possibly output a warning message.  This change
would prevent a BuildException generated in the called build.xml from
getting propagated up to the caller build.xml thus stopping your whole
build.

I suppose a similar change could be made to CallTarget.java so <ant ...
failonerror="false"/> would trap any BuildExceptions in the called target.

-Bill Burton

David.Bailey@lawson.com wrote:
> 
> Howdy.
> 
> I'm building my way down a directory tree using build.xml files in every
> subdirectory and a chain of <ant /> tasks in each build.xml.  I believe
> I have to do it this way because certain subdirectories need special handling,
> and I only want to make changes (when they are necessary) in a single build.xml
> file.
> 
> My problem is this.  I want ant to try to build everything every time, even when
> one of the <ant /> tasks in a subdirectory fails.  Sometimes an error in a
> single subdirectory will be fatal to everything in the build, and sometimes not.
> I want ant to make a strong effort to build everything every time, regardless of
> errors.
> 
> It appears, however, that a single error in one subdirectory halts the entire
> build.  I'm assuming that this is due to the fact that ant slurps up all the
> data in all the build.xml files and tries to execute everything in one fell
> swoop with a single JVM.  So the question is, short of using <java /> with the
> 'fork' attribute to perform each separate build, is there any way to get ant to
> continue building regardless of errors it may encounter?
> 
> Thanks,
> 
> --dave

Mime
View raw message