Question

SBT has triggered execution so if I execute a command like

~test

It executes all test cases and then waits for source changes. I want to extend this behavior to get triggered execution whenever input files are changed. All input files exist in a single folder. To achieve this I created a scala file in project/buildfolder:

import sbt._

class ExtendedProject(info: ProjectInfo) extends DefaultProject(info)
{
  override def watchPaths = (mainSources +++ testSources +++ mainResources 
                            +++ testResources) \ "d:\\...path to folder"
}

but when I execute the test command nothing happens! Invoking ~test waits for sometime and then exits without any output.

Is this because SBT expects all other settings to be overridden too? Is there a way to specify watchPaths in build.properties file?

Was it helpful?

Solution

try this one:

override def watchPaths = mainSources +++ testSources +++ mainResources +++ testResources +++ Path.fromFile("/path/to/your/dir")
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top