Juh_
Juh_

Reputation: 15539

How to run sbt multiple command in interactive mode

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

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

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.

Upvotes: 5

Views: 1282

Answers (1)

Justin Kaeser
Justin Kaeser

Reputation: 5948

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

> ;test:compile ;test

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

Upvotes: 6

Related Questions