This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apply plugin: 'groovy' | |
apply plugin: 'eclipse' | |
dependencies { | |
groovy localGroovy() | |
} | |
task execGroovy (type: JavaExec) { | |
classpath = sourceSets.main.runtimeClasspath | |
main = "example.Script" | |
} |
GroovyのソースはJavaのクラスにコンパイルされるので、Javaアプリケーションを実行する際と同様、タスクのtypeにはJavaExceを指定する(8行目)。mainには明示的にmainメソッドを持つクラスだけでなく、Groovyスクリプトも指定可能(10行目)。
0 件のコメント:
コメントを投稿