ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Pellow <>
Subject [submit] A build sound alert Task
Date Fri, 01 Dec 2000 04:42:44 GMT
Attached is a new Task that provides a sound alert for the user
for certain BuildEvents. Currently, it can play sounds
(I have only tested it with .aiff and .wav formats) when a build is
succesful or a different one when a build fails.

an example: 
<target name="code">
       <success source="laser1.aif" loops="0"/>
       <fail source="ohno.wav" loops="2"/>
    <mkdir dir="${build.dir}"/>
    <echo message="${build.classpath}:${build.dir}" />
    <javac srcdir="${src.dir}"

This will play laser1.aif if the build is succesful
and ohno.wav three times if the build fails!

You can also specifiy a duration amount in milliseconds.

The sound task registers a BuildListener on the current Project and then 
in the buildFinished() method it detemrines if the build was succesful
or not and
plays the appropriate file.

Please note: jdk1.3 or the JMF is required to be installed, 

Have Fun!

View raw message