ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Magnús Þór Torfason <>
Subject RE: stopping an <exec> - <exec> vs. <ant>
Date Tue, 25 Sep 2001 14:48:23 GMT
I think I must add to this an important note regarding the <ant> task.  It
does not seem to handle directories correctly.  Consider the following
build.xml file

<project name="call-bin-build" default="exec-bin-build" basedir=".">
	<target name="exec-bin-build">
		<exec executable="ant.bat" dir="bin"/>
	<target name="ant-bin-build">
		<ant antfile="build.xml" dir="bin"/>

and the output when calling these two targets, first with exec

C:\project>ant exec-bin-build
Buildfile: build.xml
     [exec] Buildfile: build.xml
     [exec] init:
     [exec]     [junit] Running com.handpoint.util.registry.test.JRegTest
     [exec]     [junit] Tests run: 2, Failures: 0, Errors: 0, Time elapsed:
0,03 sec
     [exec] Total time: 5 seconds

and then with the ant task

C:\project>ant ant-bin-build
Buildfile: build.xml
    [junit] Running com.handpoint.util.registry.test.RegTest
    [junit] Tests run: 2, Failures: 1, Errors: 0, Time elapsed: 0,03 sec

Note that the bin-build fails when using the ant call, but it is successful
when using an exec call !

Regards, Magnus

> -----Original Message-----
> From: T Master []
> Sent: 24. september 2001 22:19
> To:
> Subject: Re: stopping an <exec>
> Why are you using <exec> to call other buildfiles?
> use <ant>:
>         <ant antfile="${buildfile.dir}/${mybuildfile}" target="build">
> Unless of course, this is the way you want....
> ----- Original Message -----
> From: "Joe St. Germain" <>
> To: <>
> Sent: Monday, September 24, 2001 4:06 PM
> Subject: stopping an <exec>
> Does anyone know how to stop the processing of an <exec>.
> My <exec> kicks off a <javac> in another build.xml file.  If
> <javac> reports errors, I'd like the calling exec to stop execution
> and anything passed that exec to also stop.  If you haven't already
> guest, I've got a build.xml that controls the execution of other
> XML files via the <exec> task.  I tried the failonerror flag on both
> tasks, but it dosen't work.  I don't believe that javac returns
> anything, and that may be the reason.
> -Joe

View raw message