问题
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.
回答1:
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.
来源:https://stackoverflow.com/questions/44457452/how-to-run-sbt-multiple-command-in-interactive-mode