ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Antoine Levy-Lambert" <anto...@antbuild.com>
Subject Re: <ant> task result?
Date Thu, 20 Nov 2003 20:05:48 GMT
1) ant-contrib provides a try/catch task
2) ant comes with a MailLogger which sends emails automatically at the end
of a build, both in case of success or in case of failure.
The email recipients and the subjects are different according to whether the
build is successful or not.

Cheers,
Antoine
----- Original Message -----
From: "Cantrell David M SSgt AFRS/RSIDS" <David.Cantrell@rs.af.mil>
To: "'Ant Users List'" <user@ant.apache.org>
Sent: Thursday, November 20, 2003 5:56 PM
Subject: RE: <ant> task result?


> 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"/>
> ...
> </target>
> </project>
>
> 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.
>
> -dave
>
>  -----Original Message-----
> From: Christopher Schultz [mailto:christopher.d.schultz@comcast.net]
> Sent: Thursday, November 20, 2003 10:15 AM
> To: Ant Users List
> Subject: <ant> task result?
>
> All,
> 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"
> target="compile"
> inheritall="false" />
>
> <ant dir="${app-name} antfile="build.xml"
> target="test"
> inheritall="false" />
>
> .
> .
> .
> <!-- Email the results -->
> <mail .... />
> </target>
>
> 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.
>
> -chris
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message