Skip to content

Instantly share code, notes, and snippets.

@paulp
Last active Oct 16, 2018
Embed
What would you like to do?
continuous compilation of the sbt build
// These lines go in ~/.sbt/0.13/global.sbt
watchSources ++= (
(baseDirectory.value * "*.sbt").get
++ (baseDirectory.value / "project" * "*.scala").get
++ (baseDirectory.value / "project" * "*.sbt").get
)
addCommandAlias("rtu", "; reload ; test:update")
addCommandAlias("rtc", "; reload ; test:compile")
addCommandAlias("ru", "; reload ; update")
addCommandAlias("rc", "; reload ; compile")

sbt ~rtu

...
[success] Total time: 3 s, completed Dec 7, 2016 12:55:04 PM
4. Waiting for source changes... (press enter to interrupt)

I edit build.sbt to bump the scalatest version, and sbt reacts to the edit.

...
[info] downloading https://repo1.maven.org/maven2/org/scalatest/scalatest_2.11/3.0.1/scalatest_2.11-3.0.1.jar ...
[info] 	[SUCCESSFUL ] org.scalatest#scalatest_2.11;3.0.1!scalatest_2.11.jar(bundle) (10136ms)
[info] downloading https://repo1.maven.org/maven2/org/scalactic/scalactic_2.11/3.0.1/scalactic_2.11-3.0.1.jar ...
[info] 	[SUCCESSFUL ] org.scalactic#scalactic_2.11;3.0.1!scalactic_2.11.jar(bundle) (1000ms)
[info] Done updating.
...
[success] Total time: 14 s, completed Dec 7, 2016 12:55:30 PM
5. Waiting for source changes... (press enter to interrupt)
@hedefalk
Copy link

hedefalk commented Dec 7, 2016

Yey!

@ikhoon
Copy link

ikhoon commented Dec 9, 2016

👍

@nightscape
Copy link

nightscape commented Dec 9, 2016

Nice one! How do you always find the stuff that everyone else seems to be overlooking? ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment