ぼくのびるどはにゃあとなくプラグインを作りました
前回「ぼくのびるどはにゃあとなく」というタイトルで、ビルド完了したことを開発者に知らせるテクニックを紹介しました。
ぼくのビルドはにゃあとなく | 明日の鍵
http://tomorrowkey.hatenablog.jp/entry/2014/05/15/000000
なかなか評判がよさそうだったので、導入の敷居を下げるべくGradle Pluginにしてmaven centralにアップロードしました。
ソースコード
tomorrowkey/notifier-plugin
https://github.com/tomorrowkey/notifier-plugin
導入方法
詳しくはGithubのREADMEをご覧ください。
/build.gradle
プロジェクトのルートディレクトリのbuild.gradleにプラグインの参照を追加します。
apply plugin: 'notifier-plugin'
/app/build.gradle
ビルドするモジュールのbuild.gradleにプラグインを適用します。
buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'jp.tomorrowkey.gradle.notifier:notifier-plugin:0.0.1'
}
}
/notifier.groovy
どのような通知を使用するかはnotifier.groovy
というファイルをプロジェクトのルートディレクトリに作成してください。
人によって通知方法は異なると思うので、このファイルは.gitignoreに追加すると、個別に設定できていいんじゃないでしょうか。
voice { enabled = false name = 'Alex' } notificationCenter { enabled = true } sound { enabled = true url='file:///Users/tomorrowkey/Desktop/meow.mp3' }
助かりました
今回初めてGradle Pluginを作りました。 @__gfx__ さんのGradle Plugin Templateを使うことによって爆速で開発できました! ありがとうございます!
gfx/gradle-plugin-template
https://github.com/gfx/gradle-plugin-template
また、今回初めてmaven centralへのアップロードに挑戦しました! Yokomarkさんのこの記事のおかげで爆速でアップロードできました! ありがとうございます!
Java - Android のライブラリプロジェクトを爆速で Maven Central にデプロイする - Qiita
http://qiita.com/KeithYokoma/items/e9ee24e7f6a62623f2fb