Desktop notifications for Gradle.
A notification is sent when a build ends indicating if the build has failed or succeeded.
The plugin can be configured in an initialization script or in the build script.
It is also deployed on https://plugins.gradle.org.
For example, create (or edit) $HOME/.gradle/init.gradle
file:
initscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'fr.jcgay', name: 'gradle-notifier', version: '0.4.0'
}
}
rootProject {
apply plugin: fr.jcgay.gradle.notifier.GradleNotifierPlugin
}
In build.gradle
, add:
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath group: 'fr.jcgay', name: 'gradle-notifier', version: '0.4.0'
}
}
apply plugin: 'fr.jcgay.gradle-notifier'
The plugin is based on send-notification. Available notifiers and customization are described at this wiki.
You can rely on a property file located at $HOME/.send-notification
to configure your environment or use gradle to pass properties to the plugin.
notifier {
implementation = 'notificationcenter'
continuousNotify = false
threshold {
time = 10
unit = java.util.concurrent.TimeUnit.SECONDS
}
growl {
port = 23053
host = 'localhost'
password = 'azerty123'
}
snarl {
host = 'localhost'
port = 9887
appPassword = 's3cr3t'
}
pushbullet {
apikey = 'key123'
device = 'abcdef'
}
notifysend {
timeout = 7
path = 'notify-send'
}
notificationcenter {
path = 'terminal-notifier'
activate = 'com.apple.Terminal'
sound = 'default'
}
systemtray {
wait = 2
}
notifu {
path = 'notifu64'
}
kdialog {
path = 'kdialog'
}
anybar {
host = 'localhost'
port = 1738
}
toaster {
path = 'toast'
}
}
notifier.threshold
allows to bypass notification when the build ends before the configured threshold.
notifier.continuousNotify
activate notifications for continuous build (using --continuous
or -t
).
All parameters are configured by default, if you're fine with it, no need to write them down.
gradle-notifier
will try to find an available notifier on your system.
Notifier configuration can also be set using system properties. One can use -Dnotifier.implementation=anybar
or -Dnotifier.anybar.port=9999
to override parameters for a specific build execution.
#Notifiers
Notifier | Screenshot |
---|---|
Growl, for Windows and OS X. | |
Snarl, for Windows | |
terminal-notifier, OS X | |
notification center OS X (since Mavericks) | |
notify-send for Linux | |
SystemTray since Java 6 | |
Pushbullet | |
Kdialog for KDE | |
notifu for Windows | |
AnyBar for OS X and Linux | |
Toaster for Windows 8 |
#Build
##Set next version
./gradlew markNextVersion -Prelease.nextVersion=2.0.0
##Release
./gradlew release && ./gradlew clean publish