ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Billy Bacon <billy.ba...@thirty3.net>
Subject Re: Returning a 0 or 1 to a shell script from Ant
Date Wed, 30 Jul 2003 14:43:57 GMT
In my shell script I just have some command line calls for Ant. Like so...

ant deploy.test ### This calls the deploy.test target within my build.xml

Then if the build fails I want to be able to determine this from within the
shell script.


In your example below 'if test ! $?; then' what does the 'test' variable
stand for?

Thanks for your help.

- Billy -


On 7/30/03 12:43 AM, "Stefan Bodewig" <bodewig@apache.org> wrote:

> 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
> 
> 


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


Mime
View raw message