Is there an equivalent of gradle's JavaExec task in sbt? Here's an example from the docs to understand what I'm looking for:
apply plugin: 'java'
task runApp(type: JavaExec) {
classpath = sourceSets.main.runtimeClasspath
main = 'package.Main'
// arguments to pass to the application
args 'appArg1'
}
I need to configure classpath, main and pass some args - as in this example.
runner seems to be similar to gradle's JavaExec, for example
val runApp = taskKey[Unit]("sbt equivalent of gradle's JavaExec")
runApp := {
(runner in Compile).value.run(
mainClass = "example.Main",
classpath = (fullClasspath in Runtime).value.files,
options = Array("appArg1"),
log = streams.value.log
)
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With