-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
48 lines (40 loc) · 1.61 KB
/
build.sbt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import org.scalajs.sbtplugin.ScalaJSPlugin
import org.scalajs.sbtplugin.cross.CrossType
import play.PlayScala
import playscalajs.ScalaJSPlay
import sbt.Project.projectToRef
lazy val clients = Seq(scalajsClient)
lazy val scalaV = "2.11.6"
lazy val playServer = (project in file("play-server")).settings(
scalaVersion := scalaV,
scalaJSProjects := clients,
pipelineStages := Seq(scalaJSProd, gzip),
libraryDependencies ++= Seq(
"com.vmunier" %% "play-scalajs-scripts" % "0.2.1",
"org.webjars" % "jquery" % "1.11.1",
"org.webjars" % "chartjs" % "1.0.1"
)
).enablePlugins(PlayScala).
aggregate(clients.map(projectToRef): _*).
dependsOn(sharedJvm)
lazy val scalajsClient = (project in file("scalajs-client")).settings(
scalaVersion := scalaV,
persistLauncher := true,
persistLauncher in Test := false,
sourceMapsDirectories += sharedJs.base / "..",
unmanagedSourceDirectories in Compile := Seq((scalaSource in Compile).value),
jsDependencies += "org.webjars" % "chartjs" % "1.0.1" / "Chart.js",
skip in packageJSDependencies := false,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "0.8.0"
)
).enablePlugins(ScalaJSPlugin, ScalaJSPlay).
dependsOn(sharedJs)
lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared")).
settings(scalaVersion := scalaV).
jsConfigure(_ enablePlugins ScalaJSPlay).
jsSettings(sourceMapsBase := baseDirectory.value / "..")
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
// loads the Play project at sbt startup
onLoad in Global := (Command.process("project playServer", _: State)) compose (onLoad in Global).value