How to execute '~ copyResources' in the background while doing 'run'

We have a web project based on Unfiltered / Finagle / Netty. With local development, we would like to launch two SBT teams at once:

  • run to start the local server to check for
  • ~copyResources in the background, so that changes in JS and CSS resources are visible to running webapp

So far I have tried the following without success

  • Set the run to fork through fork in run := true, and then call both through ;run;~copyResources. The problem is that the running subprocess cannot receive input from the SBT console, so we cannot close it at the right time.

  • Set ~ copyResources to fork through fork in copyResources := true, and then call both through ;~copyResources;run. The start command does not start until the resource copy is interrupted.

  • Trying to run two tasks simultaneously with all run copyResources. I am returning an error message Cannot mix input tasks with plain tasks/settings.

+4
source share
1 answer

One solution is to use the sbt-revolver plugin . I created a small trial version of a project that uses Undertow and Handlebars . Then clone it inside the project folder:

> sbt
> re-start
> [press enter]
> ~copyResources

Open http://localhost:7070/foo, then modify template.hbs and reload. It should work similarly for your Unfiltered / Finagle setup. How do you like Unfiltered on top of Finagle? We tried Finatra a bit, but I did not like it.

Note: during execution, re-startyou can see this message:

[info] Application sbt-run-copy-resources not yet started
[info] Starting application sbt-run-copy-resources in the background ...

, . , , ~copyResources.

0

All Articles