如何在 Ammonite 中向 运行 SBT 添加参数?

How to add parameters to run SBT in Ammonite?

我想在 Ammonite 中 运行 这个 SBT 命令:

sbt -mem 3000 clean compile docker:publishLocal

我尝试了一些方法,例如:

%.sbt("-mem 3000", 'clean, 'test)(pwd)

这给出了这个例外:

[error] Expected symbol
[error] Not a valid command: -
[error] Expected end of input.
[error] Expected '--'
[error] Expected 'debug'
[error] Expected 'info'
[error] Expected 'warn'
[error] Expected 'error'
[error] Expected 'addPluginSbtFile'
[error] -mem 3000
[error]  ^

这是怎么做到的?

我最近不得不做同样的事情,我可以告诉你,当那些 "random" 错误发生时,这并不好玩。

// I had to put the full path where sbt is, like this
val SBT = "C:\Program Files (x86)\sbt\bin\sbt.bat"

%(SBT, "-mem", "3000", "clean", "compile", "docker:publishLocal")(pwd)

有了这个解决方案是:

%.sbt("-mem", "3000", 'clean, 'test)(pwd)