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のマニュアル にあるとおり、 subtitle
と sound name
がある。