aboutsummaryrefslogtreecommitdiff
path: root/build.sbt
diff options
context:
space:
mode:
Diffstat (limited to 'build.sbt')
-rw-r--r--build.sbt40
1 files changed, 29 insertions, 11 deletions
diff --git a/build.sbt b/build.sbt
index 3a529fe..3d43cd6 100644
--- a/build.sbt
+++ b/build.sbt
@@ -1,17 +1,35 @@
-name := """play-scalajs-chat"""
-organization := "com.lihaoyi"
-
version := "1.0-SNAPSHOT"
+organization in ThisBuild := "com.lihaoyi"
+scalaVersion in ThisBuild := "2.11.8"
-lazy val root = (project in file(".")).enablePlugins(PlayScala)
+lazy val server = (project in file("server"))
+ .enablePlugins(PlayScala)
+ .settings(
+ scalaJSProjects := Seq(client),
+ pipelineStages in Assets := Seq(scalaJSPipeline),
+ // triggers scalaJSPipeline when using compile or continuous compilation
+ compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
+ libraryDependencies += "com.lihaoyi" %%% "upickle" % "0.4.3"
+ )
+ .dependsOn(sharedJvm)
-scalaVersion := "2.11.8"
+lazy val client = (project in file("client"))
+ .enablePlugins(ScalaJSPlugin, ScalaJSWeb)
+ .settings(
+ persistLauncher := true,
+ persistLauncher in Test := false,
+ libraryDependencies ++= Seq(
+ "org.scala-js" %%% "scalajs-dom" % "0.9.1",
+ "com.lihaoyi" %%% "upickle" % "0.4.3"
+ )
+ )
+ .dependsOn(sharedJs)
-libraryDependencies += filters
-libraryDependencies += "org.scalatestplus.play" %% "scalatestplus-play" % "1.5.1" % Test
+lazy val shared = (crossProject.crossType(CrossType.Pure) in file("shared"))
+ .jsConfigure(_ enablePlugins ScalaJSWeb)
-// Adds additional packages into Twirl
-//TwirlKeys.templateImports += "com.lihaoyi.controllers._"
+lazy val sharedJvm = shared.jvm
+lazy val sharedJs = shared.js
-// Adds additional packages into conf/routes
-// play.sbt.routes.RoutesKeys.routesImport += "com.lihaoyi.binders._"
+// loads the server project at sbt startup
+onLoad in Global := (Command.process("project server", _: State)) compose (onLoad in Global).value