ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vincent Massol" <vmas...@octo.com>
Subject Re: condition execute task
Date Thu, 17 May 2001 18:03:49 GMT
Salut Fred !

There is a thread going on discussing whether an "if"-like task should be
added to Ant or not. The answer so far (i.e. in Ant 1.x) is that it
shouldn't be included and that any logic code should be done in java.

To answer your question, you should simply write an Ant task (very easy to
do) that does 2 things :
- check the log file for a "BUILD FAILED" message
- send the email if it does

Also, if you're looking after a way to send an email if a build fails you
should rather use a Build Listener.

Hope it helps !

P.S.: Raconte-moi ce que tu fais actuellement (projet, ...) ! Mon email:
vmassol@octo.com
A+

Vincent.

----- Original Message -----
From: "Frederic Do Couto Fernandes" <f.docoutofernandes@frontoo.com>
To: <ant-user@jakarta.apache.org>
Sent: Thursday, May 17, 2001 2:27 PM
Subject: condition execute task


> I wonder if it is possible to exeute task in some conditions !
>
> For example :
>
> <target name="compile" ....>
>
> ...
>
>   <record name="buildResult.log" action="start">
>   <javac .....>
>   </javac>
>   <record name="buildResult.log" action="stop">
>
> <!-- here, I want to send an email if the buildResult.log contains
>      "BUILD FAILED".
>      I have a class that check the buildResult.log file    -->
>
>   <mail ....... files="buildResult.log"/>
>
> ...
>
> </target>
>


Mime
View raw message