My build file is "mybuild.xml" which I called from the current build file with an ant call like:-
<ant antfile="\${prop.viewname}\xyz\mybuild.xml" dir="${prop.viewname}\xyz" output="${prop.buildlocation}\build.log"/> Now the log is in build.log . So i did a grep for "error" -----Original Message----- From: Ashutosh Kumar [mailto:[EMAIL PROTECTED] Sent: Saturday, September 11, 2004 6:26 PM To: 'Ant Users List' Subject: RE: sending mails o build failure Ankita I could not understand 1st two lines of code. Why grep is used? And how I am linking my build process to this snippet of code? Can u pls explain? Regds Ashutosh -----Original Message----- From: Ankita Kapadia [mailto:[EMAIL PROTECTED] Sent: Friday, September 10, 2004 4:27 PM To: Ant Users List Subject: RE: sending mails o build failure Here is a snippet of code I used :- *************Grep for SUCCESS/FAILURE ******************* <exec dir="${prop.buildlocation}" executable="grep" os="Windows 2000" resultproperty="status" failonerror="false" > <arg value= "error"/> <arg value= "${prop.buildlocation}\build.log"/> </exec> <condition property="status.failed"> <equals arg1="0" arg2="${status}" /> </condition> <antcall target="buildsuccess" /> <antcall target="buildfail" /> </target> <target name="buildsuccess" unless="status.failed"> <tstamp> <format property="NOW" pattern="yyyy MMMM dd HH:mm:ss" locale="en"/> </tstamp> <!-- UnWwar the war file into webapps\xyz folder --> <unwar src="${WarFileName}" dest="${UnWarLocation}" /> <echo level="info"> *************UNWAR done...******************* </echo> <mail failonerror="false" mailhost="smtp.persistent.co.in" subject="BUILD SUCCESSFUL :-) ${TODAY}" user="xyz" password="whyshuditellu" files="${prop.buildlocation}\clearcase.log,${prop.buildlocation}\build.l og" tolist="${prop.mailtolist}" > <from name="[EMAIL PROTECTED]" address="[EMAIL PROTECTED]"/> <message> ************************************************** Completed Pines Build Build Status : BUILD SUCCESSFUL ************************************************** </message> </mail> </target> <target name="buildfail" if="status.failed"> <tstamp> <format property="NOW" pattern="yyyy MMMM dd HH:mm:ss" locale="en"/> </tstamp> <mail failonerror="false" mailhost="smtp.persistent.co.in" subject="BUILD FAILED :-( ${TODAY}" user="xyz" password="whyshuditellu" files="${prop.buildlocation}\clearcase.log,${prop.buildlocation}\build.l og" tolist="${prop.mailtolist}" > <from name="[EMAIL PROTECTED]" address="[EMAIL PROTECTED]"/> <message> ************************************************* Completed Pines Build Build Status : BUILD FAILED ************************************************** </message> </mail> </target> -----Original Message----- From: Ashutosh Kumar [mailto:[EMAIL PROTECTED] Sent: Saturday, September 11, 2004 4:07 PM To: [EMAIL PROTECTED] Subject: sending mails o build failure How can I send emails automatically when build fails?through ant/maven? Regds Ashutosh --------------------------------------------------------------------- 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] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]