You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Frederic Do Couto Fernandes <f....@frontoo.com> on 2001/05/17 15:27:02 UTC
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>
RE: Carriage Return in files.
Posted by Conor MacNeill <co...@cortexebusiness.com.au>.
This looks better
<echo file="myfile.txt" append="true">This is
a multiline echo
</echo>
but interestingly it creates Unix style files on my Windows box. I might
look into that.
Conor
> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Friday, 18 May 2001 8:32 AM
> To: ant-user@jakarta.apache.org
> Subject: Re: Carriage Return in files.
>
>
> --- M Nair <ma...@mediaone.net> wrote:
> > I write to a file using the
> > <echo message="line.txt
> > line2.txt" file="myfile.txt" append="true" />
> > construct. How do I make ant insert a Carriage Return after line.txt in
> > the
> > file myfile.txt as it writes to it?
>
> Would you believe:
> <echo file="myfile.txt" append="true"
> message="line.txt
line2.txt"/>
>
> (Unless someone knows a more elegant way.)
>
> Diane
>
> =====
> (holtdl@yahoo.com)
>
>
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - buy the things you want at great prices
> http://auctions.yahoo.com/
>
Re: Carriage Return in files.
Posted by Diane Holt <ho...@yahoo.com>.
--- M Nair <ma...@mediaone.net> wrote:
> I write to a file using the
> <echo message="line.txt
> line2.txt" file="myfile.txt" append="true" />
> construct. How do I make ant insert a Carriage Return after line.txt in
> the
> file myfile.txt as it writes to it?
Would you believe:
<echo file="myfile.txt" append="true"
message="line.txt
line2.txt"/>
(Unless someone knows a more elegant way.)
Diane
=====
(holtdl@yahoo.com)
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
Carriage Return in files.
Posted by M Nair <ma...@mediaone.net>.
I write to a file using the
<echo message="line.txt
line2.txt" file="myfile.txt" append="true" />
construct. How do I make ant insert a Carriage Return after line.txt in the
file myfile.txt as it writes to it?
Thanks
Manoj Nair
Re: condition execute task
Posted by Vincent Massol <vm...@octo.com>.
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....@frontoo.com>
To: <an...@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>
>