ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Davis <nick_home_acco...@yahoo.com>
Subject RE: Is there any onFail type of capability?
Date Fri, 20 Apr 2001 20:09:59 GMT
We use a task (we wrote) which acts as a build
listener. It works like this:

<antcallAfterError target="mail" sourcetype="project"
>
    <param name="mail.subject" value="failure" />
</antcallAfterError>

The source code is attached if you are interest.

Cheers,
Nick

--- Steve Donie <sdonie@zycor.lgc.com> wrote:
> What I did is write a shell script (on NT/2K) that
> runs ant and the main
> build target, then checks the errorlevel when it
> returns, and based on that
> runs ant again, to send the mail. Much easier than
> the build listener, works
> great, and I can do things like have the subject
> line include FAILED/SUCCESS
> like this:
> 
> .
> .
> .
> call ant.bat -emacs -buildfile
> %DS_HOME%\tools\build.xml %DO_DS_LOG%
> %*||goto FAILED
> 
> :SUCCEEDED
> echo Build.bat success
> if not defined DO_DS_LOG goto BUILD_DONE
> echo Build.bat sending mail 
> call ant.bat -emacs -DBuildResult=Success -buildfile
> %DS_HOME%\tools\build.xml SendMail&goto BUILD_DONE
> 
> :FAILED
> echo Build.bat fail
> if not defined DO_DS_LOG goto BUILD_DONE
> echo Build.bat sending mail 
> call ant.bat -emacs -DBuildResult=Failed -buildfile
> %DS_HOME%\tools\build.xml SendMail&goto BUILD_DONE
> 
> :BUILD_DONE
> .
> .
> .
> DO_DS_LOG is set to -logfile=build.log for the
> nightly build machine, and
> not set on developers machines.
> 
> -----Original Message-----
> From: james [mailto:james@unikala.com]
> Sent: Thursday, April 19, 2001 11:31 AM
> To: ant-user@jakarta.apache.org
> Subject: RE: Is there any onFail type of capability?
> 
> 
> use the buildListener interface.
> 
> 
> james@unikala.com
> 
> 
> 
> -----Original Message-----
> From: Chris Stillwell
> [mailto:c-chris.stillwell@wcom.com]
> Sent: Thursday, April 19, 2001 9:07 AM
> To: ant-user@jakarta.apache.org
> Subject: Is there any onFail type of capability?
> 
> 
> I am using the mail task to notify when a build is
> complete; however, it
> doesn't get sent if the build fails.  Is there a way
> to ensure that the
> email is sent regardless of the out come of the
> build? Here's my build all
> target:
> 
>   <target name="all" description="Build everything"
>           depends="init, compile, jars, javadoc">
>     <tstamp>
>       <format property="TIME" pattern="hh:mm:ss a"/>
>     </tstamp>
>     <mail from="newwave@nwvibm00-e1"
>           tolist="c-chris.stillwell@wcom.com"
> 	  subject="NewWave Build ${TODAY}"
> 	  message="NewWave Build ${TODAY} Completed at
> ${TIME}."
> 	  mailhost="****.****.***">
>     </mail>
>   </target>
> 
> Thanks,
> 
> Chris
> 


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
Mime
View raw message