Open ches opened 6 years ago
Not certain yet how this might be achieved in plugins, or if there's a better way, but a workaround is to duplicate the task definition inConfig(Test)
:
lazy val hello = (project in file("."))
.settings(
inConfig(Test) {
import spray.revolver.Actions._
reStart := Def.inputTask{
restartApp(
streams.value,
reLogTag.value,
thisProjectRef.value,
reForkOptions.value,
(mainClass in reStart).value,
(fullClasspath in reStart).value,
reStartArgs.value,
startArgsParser.parsed
)
}.dependsOn(products in Compile).evaluated
}
)
Unfortunately with this ~test:reStart
triggered execution doesn't watch main source files, tried many forms of watchSources
and couldn't resolve that yet. Edit: this part is possibly sbt's fault, seems like there were a slew of file watch regressions in 1.0.x, follow the rabbit hole from sbt/io#102 and sbt/io#82).
For esoteric reasons (but reasonable ones can probably be imagined), I have some projects with executable classes living in the sbt test configuration.
test:run
works fine andshow test:reStart::mainClass
is set as expected, but running it fails. Here is a trivial reproduction: