简体   繁体   中英

How do I enable multiple watch sources in sbt?

I am trying to adapt this react-play seed repo . It contains the following code in build.sbt :

lazy val root = (project in file(".")).enablePlugins(PlayJava).settings(
  watchSources ++= (baseDirectory.value / "public/ui" ** "*").get
)

I would like to add another directory to watch. How do I do this? I tried variations on:

lazy val root = (project in file(".")).enablePlugins(PlayJava).settings(
  watchSources ++= (baseDirectory.value / "public/ui" ** "*").get;
  watchSources ++= (baseDirectory.value / "public2/ui" ** "*").get
)

The ++= leads me to think that the term on the right is a sequence of some sort, but I don't see how to add another directory to it. The above does not work - I get: ')' expected but ';' found. ')' expected but ';' found.

Use a comma instead of a semicolon. ++= produces a Setting ; it doesn't actually mutate anything. You can pass many of these to the method settings (via varargs), and like any other parameters you use commas.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM