Hello, As far as I can see you are trying to capture the output of some task and send emails if something goes wrong. I would suggest to have a look ant loggers and listeners[1] and especially at MailLogger[2] which collects the output of the whole build process and mails it. You can control it to send mails only on build failures.
Now regarding <javac>: first of all if you want to process its output you should set its failonerror attribute to false; by default compile errors fail the whole build (and it should be so). I also forgot to tell you there is a <record>[3] task which lets you record the output of specific parts of the build file. You already know how to search the output from a task captured in a file. This may be a tedious process if you do it for each possible part and investigating MailLogger in your case may be more useful Regards Ivan [1]http://ant.apache.org/manual/listeners.html [2]http://ant.apache.org/manual/listeners.html#MailLogger [3]http://ant.apache.org/manual/CoreTasks/recorder.html --- Rizwan Merchant <[EMAIL PROTECTED]> wrote: > > Thanks Ivan, I will try that. will the same work for > javac task? I noticed > there is no "output" or "error" attribute for the > javac task. how would i > send a failure notification email if javac fails? > > wouldnt it be simpler if ant had the functionality > to set a property for > each task in case of failure? then we can just test > the property and go > about doing what we want... > > -----Original Message----- > From: Ivan Ivanov > [mailto:[EMAIL PROTECTED] > Sent: Friday, August 19, 2005 11:08 AM > To: Ant Users List > Subject: Re: CVS failure notification.. > > > Hello, > > one way to do this is to use error and output > attributes of <cvs> task (quote from [1]): > output - the file to direct standard output from the > (cvs) command. > error - the file to direct standard error from the > (cvs) command > > So you can store the error in a text file, than load > that file as a property and check whether it > <condition>[2] whether contains a given error > message. > > Here is the pseudo code: > <cvs command="checkout" > cvsRoot=":pserver:[EMAIL PROTECTED]:/home/cvspublic" > package="my_module" > dest="${checkout.dir}" > error="${cvs.error.file}" > /> > <loadfile property="cvs.error.msg" > srcfile="${cvs.error.file}"/> > > <condition property="cvs.error"> > <contains string="${cvs.error.msg}" > > substring="<cvs_error_msg_that_might_be_returned>"> > </condition> > > The problem in this approach is that you should find > all possible cvs_error_msg_that_might_be_returned. > > Well, you can also do the following: if the error > file > is created, then obviously there is an error while > checking the module out. Instead of trying to find > the > exact error, mail the whole error file :) > > Regards > Ivan > > [1]http://ant.apache.org/manual/CoreTasks/cvs.html > [2]http://ant.apache.org/manual/CoreTasks/conditions.html > --- Rizwan Merchant <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > I'm using ant to checkout code from the CVS. If > the > > checkout is not > > successful I would like to send an email to > someone > > to notify them of the > > problem. > > > > How do I detect this error in ant? Say the > password > > on the cvs account is > > wrong, cvs notifies of bad login and then the ant > > continues executing with a > > "build successful" result (i.e. cvs exits > normally). > > > > Any ideas? Pls help. > > > > Thanks, > > -Rizwan. > > > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: > > [EMAIL PROTECTED] > > For additional commands, e-mail: > > [EMAIL PROTECTED] > > > > > > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam > protection around > http://mail.yahoo.com > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: > [EMAIL PROTECTED] > For additional commands, e-mail: > [EMAIL PROTECTED] > > ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]