You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Marcel Stör <ma...@frightanic.com> on 2004/10/27 18:23:01 UTC
"Return values" with Ant?
Hi
Scenario:
Target X in file build.xml
Target Y in file doit.xml
In X Y is called through the subant task. How can I let X know about Y's
results?
Y executes - among other things - JUnit tests with:
<junit failureProperty="test.failed" ....
and checks for failed tests:
<fail if="test.failed">Unit tests failed....
I'd like to know in X that JUnit testing failed. How to achieve that?
Regards,
Marcel
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: "Return values" with Ant?
Posted by Kris Read <kr...@gmail.com>.
If either Y or Z (or X) fails, the build fails... a fail is a fail.
If you want to have failures of prerequisite tasks that do not
necessarilly mean a failure, you can use the try/catch tags, I think
also part of antcontrib...
On Thu, 28 Oct 2004 22:26:07 +0200, Marcel Stör <ma...@frightanic.com> wrote:
> Kris Read <ma...@gmail.com> wrote:
> > Use the tasks in the antcontrib project. They have an antcall task
> > that returns a property or set of properties.
> >
> > Another way is to structure your file with the 'depends' attribute. X
> > does not execute unless Y executed.
>
> Ok, fine. Let's assume X depends on Y and Z.
>
> What happens if the JUnit tests in Y fail as with
> <fail if="test.failed">Unit tests failed.... etc
>
> Is X interrupted i.e. build failed and Z is thus never invoked?
>
>
>
> Regards,
> Marcel
>
> ---------------------------------------------------------------------
> 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
RE: "Return values" with Ant?
Posted by Marcel Stör <ma...@frightanic.com>.
Kris Read <ma...@gmail.com> wrote:
> Use the tasks in the antcontrib project. They have an antcall task
> that returns a property or set of properties.
>
> Another way is to structure your file with the 'depends' attribute. X
> does not execute unless Y executed.
Ok, fine. Let's assume X depends on Y and Z.
What happens if the JUnit tests in Y fail as with
<fail if="test.failed">Unit tests failed.... etc
Is X interrupted i.e. build failed and Z is thus never invoked?
Regards,
Marcel
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: "Return values" with Ant?
Posted by Kris Read <kr...@gmail.com>.
Use the tasks in the antcontrib project. They have an antcall task
that returns a property or set of properties.
Another way is to structure your file with the 'depends' attribute. X
does not execute unless Y executed.
On Wed, 27 Oct 2004 18:23:01 +0200, Marcel Stör <ma...@frightanic.com> wrote:
> Hi
>
> Scenario:
> Target X in file build.xml
> Target Y in file doit.xml
>
> In X Y is called through the subant task. How can I let X know about Y's
> results?
>
> Y executes - among other things - JUnit tests with:
> <junit failureProperty="test.failed" ....
>
> and checks for failed tests:
> <fail if="test.failed">Unit tests failed....
>
> I'd like to know in X that JUnit testing failed. How to achieve that?
>
> Regards,
> Marcel
>
> ---------------------------------------------------------------------
> 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