ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Returning a 0 or 1 to a shell script from Ant
Date Wed, 30 Jul 2003 06:43:51 GMT
On Tue, 29 Jul 2003, Billy Bacon <billy.bacon@thirty3.net> wrote:

> I have a crontab that executes a shell script (nightly build) and in
> my shell script I make a few calls to Ant targets.

How?  Via several invocations of the Ant shell script?  Via several
invocations of java?

> I've set up my build to fail if my unit tests do not pass
> successfully

If Ant fails, it will return a non-zero exit code.

> but how do I tell the shell script not to continue to WAR up the
> application

Make the step that does this conditional on the previous exit code,
something like this (untested) snippet

ant run-unit-tests
if test ! $?; then
  echo "Unit tests failed"
  exit 1
fi
ant build-war

Stefan

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


Mime
View raw message