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:
[EMAIL PROTECTED]
A+
Vincent.
----- Original Message -----
From: "Frederic Do Couto Fernandes" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
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>
>