日々精進

新しく学んだことを書き留めていきます

gradleでshell commandを実行する

gradleというかgroovyの機能。以下のようにしてshell commandを実行し、その結果を取得できる。

def proc = 'echo "test"'.execute()
proc.waitFor()
proc.in.text // 標準出力に出力された文字列を取得する

参考: