• Stars
    star
    12
  • Rank 1,597,372 (Top 32 %)
  • Language
    Scala
  • Created about 8 years ago
  • Updated over 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Configurable version of sbt watch feature

sbt-overwatch plugin

Build status

This plugin is smarter replacement for sbt watch feature (~ command).

Features:

  • ability to watch over multiple directories
  • ability to execute different tasks for different directories

Usage

Add this to project/plugins.sbt:

addSbtPlugin("me.scf37" % "sbt-overwatch" % "1.0.11")

Configure plugin and type overwatch:

> overwatch
[info] Waiting for changes on /home/scf37/dev/sbt-overwatch/test includes: **/*.js
[info] Waiting for changes on /home/scf37/dev/sbt-overwatch/test/src/main/resources includes: **/*.css
[info] Waiting for changes on /home/scf37/dev/sbt-overwatch/test includes: **/*.scala
[info] Waiting for changes... (press enter to interrupt)

Plugin configuration constists of fileset -> sbt task pairs. overwatchFilter supports jdk globs or simple Path => Boolean closures.

overwatchConfiguration in Global := Map(
  overwatchFilter(baseDirectory.value, "**/*.js") -> (task1 in overwatchTest),
  overwatchFilter(baseDirectory.value / "src/main/resources", "**/*.css") -> (task2 in overwatchTest),
  overwatchFilter(baseDirectory.value , "**/*.scala") -> (task3 in overwatchTest)
)

See test/build.sbt for complete example including sbt-revolver integration.