I am trying to complete a task to run my jar file in gradle.
I came up with the following:
task runJar(dependsOn:[jar]){ ant.java(jar:,fork:true) }
However, I cannot find the path to the jar file. Any help is greatly appreciated. Thanks!
Misha
EDIT: OK this is pretty weird. This task is performed before compilation, etc.
EDIT: Fixed. The key is in the note doLast {} or, in abbreviated form
task runJar(dependsOn:"jar")<<{ ant.java(jar:"${libsDir}${File.separator}${archivesBaseName}.jar",fork:true) }
Misha
java gradle
Misha Koshelev
source share