ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick Pellow <n...@cortexebusiness.com.au>
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">
    <sound>
       <success source="laser1.aif" loops="0"/>
       <fail source="ohno.wav" loops="2"/>
    </sound>
    <mkdir dir="${build.dir}"/>
    <echo message="${build.classpath}:${build.dir}" />
    <javac srcdir="${src.dir}"
           destdir="${build.dir}" 
           classpath="${build.classpath}"
           debug="on"
           deprecation="on"/>
  </target>


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!

Nick
Mime
View raw message