Mais conteúdo relacionado
Semelhante a ぼくのビルドはにゃあとなく (7)
Mais de Tomoki YAMASHITA (7)
ぼくのビルドはにゃあとなく
- 26. ビルド完了時に
音を鳴らすコード
android.applicationVariants.all { variant ->
if (variant.install != null) {
variant.install.doLast {
String url = http://example.com/sound.wav ;
String path = "${project.buildDir}/finish_sound"
def file = new File(path)
if(!file.exists()) {
new URL(url).withInputStream { input ->
file.bytes = input.bytes
}
}
['afplay', path].execute()
}
}
}
※人のサーバを勝手に使うのはお行儀悪いのでやめましょう