Using Post-Build feature in Eclipse is a great way to augment a build with all kind of actions. What if the build takes a long time and you want to get notified? One way is to play a sound at the end of the build process.

There are for sure different ways for this, but what worked for me under Windows is to call a small batch file present in my project called ‘beep.bat’ with following content:
powershell -c (New-Object Media.SoundPlayer "C:\Windows\Media\notify.wav").PlaySync()

Then I call this batch file from the post-build settings:

Make sure you have the Windows audio enabled and volume turned on. With this, there is a nice sound of my choice at the end of the build process.
The above screenshots are for the MCUXpresso IDE. If using CodeWarrior then the build steps are a bit different, but the same approach works there too. Just use
call ../beep.bat
instead :-).

With this you can turn the build into a sound generation event (just be sure you don’t upset your office neighbor if any) ;-).
Happy Sounding š
Did you try to import your projects on a non-Windows machine?
LikeLiked by 1 person
Yes, I do. That command line is for Windows. In such cases I have different build configurations for Windows and Linux.
LikeLike
On another note: I did try the ‘echo ^G’ thing too which should be portable, but somehow that did not work. Unless you have a better idea?
LikeLike
On Unix it is `echo -ne ‘\007’`, but I have no idea if the echo provided in the Windows Build Tools accepts this.
LikeLiked by 1 person
yes, ‘echo’ is accepted, but does not work as intended with -ne option. On Windows one could use ‘echo ^G’ (note that ^G is generated with +G) but control codes are somehow not accepted in the Eclipse input edit fields.
LikeLike
You can also use this approach to play some pre-recorded cussing for failed builds.
LikeLiked by 1 person
Yes, I had the same idea, but the post-build action is only executed for a successful build. Not sure how I could react on a failed build. Maybe someone has an idea?
LikeLike
I used a similar technique and found out the same thing Erich did: It only does the post-build action on successful builds. We need a way to hook into the error, or when the build system goes idle for whatever reason.
LikeLiked by 1 person
The only think I can think of is to watch file handle and perhaps you can see when the builder opens the log file and when it closes it. Make a sound when the file is closed.
LikeLike
That’s certainly a way or use case too.
LikeLike