【问题标题】:How to run tests and then application on save?如何运行测试然后保存应用程序?
【发布时间】:2016-07-24 16:39:54
【问题描述】:

在 sbt 中,要在保存时运行测试,我会执行“~test”。当我想在保存时运行应用程序时,我会执行“~run”。如果我想先运行测试,然后在保存时运行应用程序,该怎么办?

我尝试了“~ all test run”,但它给了我一个错误

> ~ all test run
[error] Cannot mix input tasks with plain tasks/settings.  Input task(s):
[error]         ScopedKey(Scope(Select(ProjectRef(file:/home/johnreed/sbtProjects/activatorProjects/hello-scala/,hello-scala)),Select(ConfigKey(compile)),Global,Global),run)
[error]  Task(s)/setting(s):
[error]         ScopedKey(Scope(Select(ProjectRef(file:/home/johnreed/sbtProjects/activatorProjects/hello-scala/,hello-scala)),Select(ConfigKey(test)),Global,Global),test)
[error] 
[error] all test run

附言我希望能够通过单击绿色的“运行”按钮自动连续运行测试并从 IntelliJ 社区版运行 Play 应用程序。

【问题讨论】:

标签: scala intellij-idea playframework sbt typesafe-activator


【解决方案1】:

在 sbt shell 中,执行~ ; test ; run

[scala-morning-warmup]> help ;
; command1 ; command2 ...

    Runs the specified commands.

如果您在命令行上,则必须确保 ~ ; test ; run 被视为 sbt 的单个输入参数,因此请双引号。

sbt "~ ; test ; run"

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-24
    • 1970-01-01
    • 2014-05-31
    相关资源
    最近更新 更多