-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.sbt
More file actions
39 lines (33 loc) · 1.47 KB
/
Copy pathbuild.sbt
File metadata and controls
39 lines (33 loc) · 1.47 KB
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
lazy val scalaV = "2.11.7"
val sharedDependencies = Def.setting(Seq(
"com.lihaoyi" %%% "upickle" % "0.4.3"
))
val clientDependencies = Def.setting(sharedDependencies.value ++ Seq(
"org.scala-js" %%% "scalajs-dom" % "0.9.1",
"org.singlespaced" %%% "scalajs-d3" % "0.3.2"
))
val serverDependencies = Def.setting(sharedDependencies.value ++ Seq(
"com.vmunier" %% "scalajs-scripts" % "1.0.0",
"org.scalatestplus.play" %% "scalatestplus-play" % "1.5.0" % Test
))
lazy val server = (project in file("server")).settings(
scalaVersion := scalaV,
libraryDependencies ++= serverDependencies.value,
scalaJSProjects := Seq(client),
pipelineStages in Assets := Seq(scalaJSPipeline),
// pipelineStages := Seq(digest, gzip),
compile in Compile <<= (compile in Compile) dependsOn scalaJSPipeline
).enablePlugins(PlayScala, LauncherJarPlugin).dependsOn(crossJvm)
lazy val client = (project in file("client")).settings(
scalaVersion := scalaV,
persistLauncher := true,
libraryDependencies ++= clientDependencies.value
).enablePlugins(ScalaJSPlugin, ScalaJSWeb).dependsOn(crossJS)
lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared")).settings(
scalaVersion := scalaV,
libraryDependencies ++= sharedDependencies.value
).jsConfigure(_ enablePlugins ScalaJSWeb)
lazy val crossJvm = shared.jvm
lazy val crossJS = shared.js
// loads the server project at sbt startup
onLoad in Global := (Command.process("project server", _: State)) compose (onLoad in Global).value