I'm trying to get play (exactly sbt-web) to access the javascript files created from scala.js.
With unmanagedResourceDirectories in Assets +=
I'm able to set a paht for the sbt-web to automatically copy to the right asset directory. The problem is that I won't hardcode the path to the javascript files.
My Build.scala looks like this:
import play.Play._
import com.typesafe.sbt.web.Import.Assets
import scala.scalajs.sbtplugin.ScalaJSPlugin._
import scala.scalajs.sbtplugin.ScalaJSPlugin.ScalaJSKeys._
object Build extends sbt.Build {
override def rootProject = Some(jvm)
lazy val js = project
.settings(scalaJSSettings: _*)
.settings(
scalaVersion := "2.11.2"
)
lazy val jvm = project
.settings(play.PlayScala)
.settins(
scalaVersion := "2.11.2",
// This is the interesting line
unmanagedResourceDirectories in Assets += (target in js).value / "scala-2.11",
compile in Compile <<= (compile in Compile) dependsOn (fastOptJS in (js, Compile))
)
.aggregate(js)
}
Is there a way to get the output path of the javascript from scala.js?
(target in js).value / "scala-2.11"
works, but there is the hardcoded scala-2.11
and the classes
directory in the assets output.
Another Problem is that the files now are under web/public/main/
instead of web/public/main/js
.