Global ANT or MAVEN build event notification

I want to get notified when the build is finished.

I prefer ANT to play a small sound saying that the build is finished so I can stop reading news, drinking coffee, doing self education of course.

Luckily ant and maven have global build callback support. Internally they call a batch file from user home dir in case a build finishes successfully.

So to have the sound played after the build define the following files in user home dir:

mavenrc_post.bat


echo “hello from maverc_post.bat”

@echo off
set “file=C:\Windows\Media\tada.wav”
( echo Set Sound = CreateObject(“WMPlayer.OCX.7″^)
echo Sound.URL = “%file%”
echo Sound.Controls.play
echo do while Sound.currentmedia.duration = 0
echo wscript.sleep 100
echo loop
echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs
start /min sound.vbs


antrc_post.bat


echo “hello from maverc_post.bat”

@echo off
set “file=C:\Windows\Media\tada.wav”
( echo Set Sound = CreateObject(“WMPlayer.OCX.7″^)
echo Sound.URL = “%file%”
echo Sound.Controls.play
echo do while Sound.currentmedia.duration = 0
echo wscript.sleep 100
echo loop
echo wscript.sleep (int(Sound.currentmedia.duration^)+1^)*1000) >sound.vbs
start /min sound.vbs


 

Advertisements

About andrewosipenko

Java dev. Groovy dev. Grails dev. Project man.
This entry was posted in IT, Java. Bookmark the permalink.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s