Skip to content

Instantly share code, notes, and snippets.

@paulp
Last active October 16, 2018 19:09
Show Gist options
  • Star 26 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save paulp/895ba644174b8a2bf39126787218078b to your computer and use it in GitHub Desktop.
Save paulp/895ba644174b8a2bf39126787218078b to your computer and use it in GitHub Desktop.
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)
@ikhoon
Copy link

ikhoon commented Dec 9, 2016

👍

@nightscape
Copy link

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