Steve Matyas of 5AM Solutions and I developed an Ambient Orb Ant task that changes the color of an Ambient Orb based on a build event. There are many uses for an Orb, but the purpose of this task is to change the color, animation or comment of your Orb when a build passes or fails. If you’re creative, you can configure your build script to gradually change the color of the Orb based on certain conditions (e.g. you are exceeding your code duplication percentage threshold). The Ambient Orb Ant task is hosted at Quality Labs.

Ambient Orb

So, rather than just a binary representation (such as X10), there are virtually limitless combinations of colors and animations with an Ambient Orb.

The task is setup as a listener that listens for build events (pass or fail). Consequently, when you define the task, you are registering the task to listen to build events. Based on the build status, the Orb color is changed. Because it checks the build status, you probably want to execute this task as one of the first tasks in your build script - in case your build fails early. For instance, you may choose to use your init task in Ant.

Steps to using the Ambient Orb Ant task
1) Download the Ambient Orb Ant task
2) Place the extracted jar in your Ant class path
3) Define an Ant target and configure as demonstrated below:

<target name="registerOrb">
  <path id="orb.class.path">
    <fileset dir="${ant.home}">
      <include name="ambientorb-0.5.jar"/>
    </fileset>
  </path>
  <taskdef classname="org.qualitylabs.ambientorb.ant.OrbTask"
     name="orb" classpathref="orb.class.path"/>
  <orb listener="org.qualitylabs.ambientorb.ant.OrbListener"
    deviceId="AAA-99A-AAA"
    colorPass="green"
    colorFail="red"
    animationFail="heartbeat"
    animationPass="none"
    commentPass="The+build+passed"
    commentFail="Build+Failure!!" />
</target>

In this example, if the build passes, your Orb’s color will change to green (12) or red (0) if it fails. Pretty cool, huh? In the example, you’ll need to change the deviceId attribute. This attribute is the unique identifier located on the bottom of your Orb. Notice the use of the plus (+) sign to indicate spaces in the commentPass and commentFail attributes. Go here for additional documentation. A short movie demonstrates the installation, configuration and use of this task.

The project is open source and free to download and use. If you’ve got ideas for improving it, comment here or feel free to join the Quality Labs project.