Information Technology Reference
In-Depth Information
sound byte from the movie Office Space saying “We've got sorta a
problem here.” If the build succeeded, it plays “Houston, we are go for
launch” from the movie Apollo 13. On some of our projects, the devel-
opment group works in the same room as the build machine. Using the
same sounds, the build machine announces success or failure from its
speakers. Listing 9-5 demonstrates an Ant delegating build script that
provides this functionality. This delegating build script is called by the
CruiseControl configuration file (config.xml).
LISTING 9-5 Register Sounds with CruiseControl
<project name="project-delegating-build” default=”run-cc-build">
<target name="run-cc-build” depends="registerSounds ">
</target>
<property name="sounds.dir" location=" PATH_TO_SOUNDS "/>
<target name="registerSounds" if="use.sounds">
<sound>
<fail source="${sounds.dir}/failure/problemhere.wav"/>
<success source="${sounds.dir}/success"/>
</sound>
</target>
</project>
A bit of explanation is in order.
• You will register the build sounds in your delegating-build.xml,
and make sure the <sound> task is invoked at the beginning of
your script.
•The <fail> element will play a specific sound file from the
build failure sounds directory.
•The <success> element will play a specific sound file from the
build success sounds directory.
• You need to replace the PATH_TO_SOUNDS value with the location
of your sounds directory.
• You can enable and disable the use of build sounds from your
CruiseControl config.xml file by setting the value of the
use.sounds property.
Again, we really believe in incorporating gadgets, noises, and noti-
fication styles that make environments more fun and personalized
Search WWH ::




Custom Search