C.28 GrowlNotifyTask

When you have a long process and want to be notified when it is finished, without to stay focused on the console windows. Then use the GrowlNotify task.

This task requires the PEAR Net_Growl package installed (version 2.6.0).

Features

Table C.29: Attributes

NameTypeDescriptionDefaultRequired
nameStringName of application to be registerGrowl for PhingNo
stickyBooleanIndicates if the notification should be sticky on desktopfalseNo
messageStringText of notification. Use \n to specify a line breakn/aYes
titleStringTitle of notificationGrowlNotifyNo
notificationStringThe notification name/typeGeneral NotificationNo
appiconString
  • absolute url (http://domain/image.png)

  • absolute file path (c:\temp\image.png)

  • relative file path (.\folder\image.png)

n/aNo
hostStringThe host address where to send the notification127.0.0.1No
passwordStringThe password required to send notifications over networkn/aNo
priorityString

The notification priority. Valid values are :

  • low

  • moderate

  • normal

  • high

  • emergency

normalNo
protocolStringThe protocol used to send the notification. May be either gntp or udp.gntpNo
iconString

The icon to show for the notification.

Must be a valid file type (png, jpg, gif, ico). Can be any of the following:

  • absolute url (http://domain/image.png)

  • absolute file path (c:\temp\image.png)

  • relative file path (.\folder\image.png)

embedded growl icon v2No

C.28.1 Examples

Send a single notification on a remote host

Both sender and Growl client (Mac or Windows) should share the same password.

<?xml version="1.0" encoding="UTF-8"?>
<project name="phing-GrowlNotifyTask" basedir="." default="notification">

    <taskdef name="growlnotify" classname="phing.tasks.ext.GrowlNotifyTask" />

    <target name="notification"
        description="display a single message with growl gntp over network"
    >
        <growlnotify message="Deployment of project LAMBDA is finished."
            host="192.168.1.2"
            password="seCretPa$$word"
        />
    </target>

</project>

Send a single notification with UDP protocol

When you don't have a Macintosh, OS compatible with Growl GNTP, you should use the basic UDP protocol.

<?xml version="1.0" encoding="UTF-8"?>
<project name="phing-GrowlNotifyTask" basedir="." default="notification">

    <taskdef name="growlnotify" classname="phing.tasks.ext.GrowlNotifyTask" />

    <target name="notification"
        description="display a single message with growl udp over network"
    >
        <growlnotify message="Notify my MAC that does not accept GNTP."
            host="192.168.1.2"
            password="seCretPa$$word"
            protocol="udp"
        />
    </target>

</project>

Send an important notification

If you want to send a notification that is so important that you don't want to missed it, even if you are away from your computer. Use the sticky attribute.

<?xml version="1.0" encoding="UTF-8"?>
<project name="phing-GrowlNotifyTask" basedir="." default="notification">

    <taskdef name="growlnotify" classname="phing.tasks.ext.GrowlNotifyTask" />

    <target name="notification"
        description="display a sticky message on desktop"
    >
        <growlnotify message="Project LAMDBA, unit tests FAILED."
            priority="high"
            sticky="true"
        />
    </target>

</project>

Use your icons to identify an application

You may customize the Growl notification system, with different icons and more.

<?xml version="1.0" encoding="UTF-8"?>
<project name="phing-GrowlNotifyTask" basedir="." default="notification">

    <taskdef name="growlnotify" classname="phing.tasks.ext.GrowlNotifyTask" />

    <target name="notification"
        description="display a custom icon message"
    >
        <growlnotify message="Have a look on my beautiful message!"
            name="phing Notifier"
            title="phing notification"
            priority="low"
            sticky="false"
            appicon="../images/my_icon.png"
        />
    </target>

</project>