Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run sbt multiple command in interactive mode

Tags:

sbt

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.

like image 766
Juh_ Avatar asked Jun 09 '17 12:06

Juh_


1 Answers

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.

like image 155
Justin Kaeser Avatar answered Dec 02 '22 03:12

Justin Kaeser