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

Attachment: SoundTask.java
Description: JavaScript source

Attachment: AntSoundPlayer.java
Description: JavaScript source

Reply via email to