Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Modifying watchpaths

Tags:

scala

sbt

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?

like image 470
thequark Avatar asked Nov 05 '22 10:11

thequark


1 Answers

try this one:

override def watchPaths = mainSources +++ testSources +++ mainResources +++ testResources +++ Path.fromFile("/path/to/your/dir")
like image 107
Piotr Maj Avatar answered Nov 26 '22 12:11

Piotr Maj