5

Sbt can re-run tasks when some of watched files have changed (~task). How to find out which files have changed?

dk14
  • 22,206
  • 4
  • 51
  • 88
  • In the command window it will tell you which files it is recompiling. Is that what you are looking for? Not certain what the purpose of your question is. – James Black Nov 08 '12 at 17:40
  • i have input xml-files for integration testing and i need re-run tests on file-change (and only for changed files). – dk14 Nov 09 '12 at 11:31

1 Answers1

3

You can add this to your build.sbt to see what files are watched:

watchSources ~= { files =>
  println(files.mkString("\n")+"\n\n\n")
  files//here you can add files or filter out
}

It might help you to test specific Test classes: ins sbt (interactice mode):

~test-only full.path.test.ClassName

To track file changes in general you can use Java 7 WatchService or Apache VFS for Java 6.

Source: WatchService for Java 6

Community
  • 1
  • 1
Schleichardt
  • 7,502
  • 1
  • 27
  • 37