Chapter 33. The Announce Plugin

The Gradle announce plugin enables you to publish messages on succeeded tasks to your favourite platforms. It supports

33.1. Usage

To use the announce plugin, include in your build script:

Example 33.1. Using the announce plugin

build.gradle

apply plugin: 'announce'

After that, configure you username and password (if required for the service you want to announce to) with:

Example 33.2. Configure the announce plugin

build.gradle

announce {  
  username = 'myId'
  password = 'myPassword'
}

Finally, you can use announce with any task by attaching it via task.dolast() as shown below

Example 33.3. Using the announce plugin

build.gradle

task helloWorld << {  
    ant.echo(message: "hello") 
}  

helloWorld.doLast {  
    announce("Build complete", "notify-send")
    announce("Build complete", "twitter")
}

As you can see, the syntax in .doLast is

announce("MESSAGE", "TARGET")

Where MESSAGE is any GString you pass (and might have constructed before). And TARGET might one of the following:

Table 33.1. announce plugin targets

target literal target configuration parameters more information
twitter Twitter username , password
snarl Snarl Windows Notification Service
growl Growl Mac OS X Notification Service
notify-send Notify Ubuntu Notification Service You need to have notify-send installed for this. Run sudo apt-get install libnotify-bin on Ubuntu to install it.

33.2. Tasks

TBD

33.3. Project layout

TBD

33.4. Dependency management

TBD

33.5. Convention properties

The announce plugin adds an TBD

TBD