LoginSignup
0
2

More than 5 years have passed since last update.

Spock実行後に結果を表示するGradle Taskを作った

Last updated at Posted at 2016-01-20

※まだMacでしか試せていないです。。。

やりたいこと

  • spock実行後にテスト結果を確認したい
  • 勝手にブラウザで開くようにしたい

ビルドスクリプト

build.gradle
task spock(type:Exec, dependsOn:"test") {
    executable 'open'
    args 'build/reports/tests/index.html'
}

※「open」のところを、ブラウザのパスにすればOS関係なくなると思います。

実行

gradle spock

処理の流れ

  • test実行
  • 結果表示(ブラウザで開く)

参考

Gradleからのコマンド実行方法
http://sakebook.hatenablog.com/entry/2014/09/03/084456

タスクの依存関係 (6.5節)
http://gradle.monochromeroad.com/docs/userguide/tutorial_using_tasks.html

0
2
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
0
2