ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: Conditional target execution
Date Thu, 08 Mar 2001 06:57:33 GMT
Krishanu Lahiri <klahiri@bizagile.com> wrote:

> How does one allow a target to be executed only if a previous target
> has completed ?

Using depend, just like you did.

> How do I allow target "deploy" to be executed ONLY if target
> "unittest" completed successfully.

You need to make your unittest target stop the build process. The only
way Ant knows that a task fails is if the task tells it - by throwing
an Exception.

> I am running the <junit> task in the "unittest" target. This target
> always seems to complete even if the actual test failed.

Take a look at the haltonerror and haltonfailure attributes of
<junit>.

Stefan

Mime
View raw message