ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cantrell David M SSgt AFRS/RSIDS <>
Subject RE: <ant> task result?
Date Thu, 20 Nov 2003 16:56:36 GMT
I was talking to a co-worker the other day, and I mentioned that I'd like to
see something like this in ant:

	<project name="foo" default="build" onfailure="failed">
		<target name="failed">
			<mail ... />
			<antcall target="clean"/>

Keep in mind this is just an idea, and we are evaluating ant for future use
so I'm not sure if this has already been brought up and then put to rest.


 -----Original Message-----
From: 	Christopher Schultz [] 
Sent:	Thursday, November 20, 2003 10:15 AM
To:	Ant Users List
Subject:	<ant> task result?

I have searched the archives and found a possible course of action, but 
I wanted to run it by everyone and see if there was a better way to do it.

I am re-vamping the nightly build for my project. The project itself 
uses ant, and I will be using ant for the nightly build as well. What 
I'd like to do is have a separate build script that will start a 
recorder, do a cvs checkout, compile, unit test, etc. ultimately ending 
up with a deployment to our test server.

I have something like this:

<target name="build" depends="start-recorder">
	<ant dir="${app-name} antfile="build.xml"
		inheritall="false" />

	<ant dir="${app-name} antfile="build.xml"
		inheritall="false" />

	<!-- Email the results -->
	<mail .... />

The thing is, I'd like to bail out if the compile fails, and still send 
the email. From a shell-script, I would just check the exit code of the 
task and jump to the mail task, but it looks like I can't do that here.

I found Antelope's <AntFetch> task, but that will require me to modify 
the build script for my application just so that the nightly build 
script can read properties from it (like, I'd set "compile.success" 
after the <javac> task in the build script, then check its value in the 
night build script).

Is this the best way to do this? What other options do I have? Should I 
consider just dropping ant and using straight shell scripts for the 
nightly build?

Thanks in advance for any advice.


To unsubscribe, e-mail:
For additional commands, e-mail:

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message