I have a scalatra project within which I want to serve JavaScript that's been generated from a scala.js project.
I have a multi-project sbt build that allows me to build both these project successfully. That is, I can use the compile (and run) tasks in the scalatra project; and I can use the packageJS task in the scala.js project.
However, I'd very much like to be able to have the scalatra compile task depend on the scala.js packageJS task; so when the Scalatra project is compiled, the Javascript is automatically generated in the Scala.js project.
In my multi-project build.sbt file I've tried:
lazy val wwwjs = project // Scala.js project
lazy val www = project // Scalatra project
.dependsOn(wwwjs % "compile->packageJS")
But when compiling the Scalatra project this fails with "configuration not found in wwwjs#wwwjs_2.10;0.1: 'packageJS'. It was required from www#www_2.10;0.1 compile".
I'm fairly new to sbt (and Scalatra and Scala.js!) - can anyone enlighten me as to how to do this?
Thanks :)