LoginSignup
9
9

More than 5 years have passed since last update.

GradleからOSX notification centerに通知をするスニペット

Posted at

osascript(1) で AppleScript を実行すればできる。

void growl(String title, String message) {
    def proc = ["osascript", "-e", "display notification \"${message}\" with title \"${title}\""].execute()
    if (proc.waitFor() != 0) {
        throw new GradleException(proc.err.text.trim());
    }
}

他のオプションは display notificationのマニュアル にあるとおり、 subtitlesound name がある。

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9