【发布时间】:2015-07-31 23:29:58
【问题描述】:
我正在 SBT 中实现一个自定义任务,它运行一些外部 Java 类。我正在使用runner 任务来执行此操作。
myCustomTask := {
val mainClass: String = ???
val classpath: Seq[File] = ???
val options: Seq[String] = ???
runner.value.run(mainClass, classpath, options, streams.value.log)
}
我想配置此任务,使其在单独的 JVM 中运行。通常,这是使用fork 选项配置的,然后由runner 任务引用。
我只想为我的自定义任务配置分叉。我试过这样做:
fork in myCustomTask := true
但它不起作用。 runner 任务仍然获得不变的 fork 值。
我还尝试通过使用(runner in myCustomTask) 而不是仅使用runner 来调整任务本身,但这也无济于事。
如何将fork 设置为true 仅用于myCustomTask?
【问题讨论】: