The Gradle announce allows to send custom announcements during a build. The following notification systems are supported: 通知プラグインを使うと、ビルド実行中に通知を送信することができます。以下の通知システムがサポートされています。
To use the announce plugin, apply it to your build script:
通知プラグインを使うには、まずビルドスクリプトにプラグインを適用してください。
Next, configure your notification service(s) of choice (see table below for which configuration properties are available):
次に、選んだ通知方法に応じて設定を行います。設定用のプロパティについては、以下のテーブルを参照してください。
Finally, send announcements with the announce method:
最後に、announceメソッドで通知を送信します。
Example 42.3. 通知プラグインを使用する
build.gradle
task helloWorld << {
println "Hello, world!"
}
helloWorld.doLast {
announce.announce("helloWorld completed!", "twitter")
announce.announce("helloWorld completed!", "local")
}The announce method takes two String arguments: The message to be sent, and the notification
service to be used. The following table lists supported notification services and their configuration properties.
announceメソッドは二つの引数を取ります。一つは通知メッセージで、もう一つは使用する通知用サービスです。
サポートされている通知用サービスとその設定値は以下の通りです。
Table 42.1. 通知プラグイン対応サービス Announce Plugin Notification Services
| Notification Service 通知サービス | Operating System オペレーティングシステム | Configuration Properties 設定プロパティ | Further Information 備考 |
| Any 何でも | username, password | ||
| snarl | Windows | ||
| growl | Mac OS X | ||
| notify-send | Ubuntu | Requires the notify-send package to be installed. Use sudo apt-get install libnotify-bin
to install it. notify-sendパッケージをインストールする必要があります。sudo apt-get install libnotify-binを実行してインストールしてください。 |
|
| local | Windows, Mac OS X, Ubuntu | Automatically chooses between snarl, growl, and notify-send depending on the current operating system. snarl、growl、notify-sendの中から、オペレーティングシステムに応じて自動的に選択します。 |