I'm running compile test:compile it:compile
quite often and...would like to cut the number of keystrokes to something like *:compile
. It doesn't seem to work, though.
$ sbt *:compile
[info] Loading global plugins from /Users/jacek/.sbt/0.13/plugins
[info] Loading project definition from /Users/jacek/oss/scalania/project
[info] Set current project to scalania (in build file:/Users/jacek/oss/scalania/)
[error] No such setting/task
[error] *:compile
[error] ^
Is it possible at all? I use SBT 0.13.
We have a build. sbt file that is used for multiple projects. Doing sbt test:compile compiled the tests for every single project and took over 30 minutes.
sbt shell has a command prompt (with tab completion and history!). To compile again, press up arrow and then enter. To run your program, type run . To leave sbt shell, type exit or use Ctrl+D (Unix) or Ctrl+Z (Windows).
test:compile
implies a compile
so compile
doesn't need to be explicitly run before test:compile
. If your IntegrationTest
configuration extend
s Test
, it:compile
implies test:compile
.
One option is to define an alias that executes multiple commands:
sbt> alias compileAll = ; test:compile ; it:compile
See help alias
and help ;
for details. You can make this a part of your build with:
addCommandAlias("compileAll", "; test:compile ; it:compile")
The other option is to define a custom task that depends on the others and call that:
lazy val compileAll = taskKey[Unit]("Compiles sources in all configurations.")
compileAll := {
val a = (compile in Test).value
val b = (compile in IntegrationTest).value
()
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With