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>