Chapter 40. The Announce Plugin

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

40.1. Usage

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

Example 40.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 40.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 40.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 40.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.

40.2. Tasks

TBD

40.3. Project layout

TBD

40.4. Dependency management

TBD

40.5. Convention properties

The announce plugin adds an TBD

TBD