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: 'java' | |
apply plugin: 'eclipse' | |
task execJava (type: JavaExec) { | |
classpath = sourceSets.main.runtimeClasspath | |
main = "example.Main" | |
} |
タスクのtypeには、JavaExceを指定する(4行目)。classpathには実行時のクラスパスとしてsourceSets.main.runtimeClasspathを通すしておくのがミソ(5行目)。mainにはmainメソッドをもつクラスの完全修飾クラス名を指定する(6行目)。
0 件のコメント:
コメントを投稿