【问题标题】:How to add parameters to run SBT in Ammonite?如何添加参数以在 Ammonite 中运行 SBT?
【发布时间】:2019-12-07 20:27:20
【问题描述】:

我想在 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]  ^

这是怎么做到的?

【问题讨论】:

    标签: scala sbt ammonite


    【解决方案1】:

    我最近也遇到了同样的事情,我可以告诉你,当那些“随机”错误发生时,这并不好玩。

    // 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)
    

    【讨论】:

    • 谢谢 - 有了你的回答 - 这行得通:%.sbt("-mem", "3000", 'clean, 'test)(pwd)。如果您将此添加到您的答案中,我可以接受;)。
    猜你喜欢
    • 2017-10-18
    • 2020-01-01
    • 2017-09-24
    • 2019-03-01
    • 1970-01-01
    • 2017-01-25
    • 2020-12-10
    • 2020-06-18
    • 1970-01-01
    相关资源
    最近更新 更多