All Downloads are FREE. Search and download functionalities are using the official Maven repository.

jp.tomorrowkey.gradle.notifier.NotificationCenterNotifier.groovy Maven / Gradle / Ivy

There is a newer version: 1.0.1
Show newest version
package jp.tomorrowkey.gradle.notifier

public class NotificationCenterNotifier implements Notifier {

    Commander commander;

    public void performNotify(task, state) {
        commander = new Commander(task.logger)

        def title = "Gradle task"

        if (state.failure) {
            growl(title, "$task.name task is failed")
        } else {
            growl(title, "$task.name task is finished")
        }
    }

    void growl(String title, String message) {
        commander.execute("osascript", "-e", "display notification \"${message}\" with title \"${title}\"")
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy