如何在交互模式下运行 sbt multiple 命令 [英] How to run sbt multiple command in interactive mode

查看:37
本文介绍了如何在交互模式下运行 sbt multiple 命令的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在 sbt 交互模式下运行多个 sbt 命令,即不离开 sbt shell"?

I want to run several sbt-commands within sbt interactive mode, i.e. without leaving the sbt "shell"?

(注意:一些问题回答如何在标准 shell 中使用 sbt 将参数传递给 sbt-commands.不是我想要的)

(Note: Some questions answer how to pass argument to sbt-commands using sbt in the standard shell. Not what I wnat here)

示例:我在 sbt 交互式 shell 中,我想运行test:compile",然后运行test"

Example: I am in sbt interactive shell, and I want to run "test:compile", then "test"

我知道测试会调用所需的编译,但在这个例子中,我想在任何测试开始之前运行所有子项目的编译.

I know test will call required compilation, but in this example I want to run the compilation of all sub-projects, before any test is started.

推荐答案

要在 sbt shell 中按顺序运行命令,请使用 ; 链接命令:

To run commands sequentially within the sbt shell, use ; to chain commands:

> ;test:compile ;test

但是请注意,如果需要,运行 test 任务将编译您的源代码,而无需显式运行 compile 任务.

Note however that running the test task will compile your sources if necessary without you having to explicitly running the compile task.

这篇关于如何在交互模式下运行 sbt multiple 命令的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆