From e317debf1a5d639c9a5fde0f0353a7b3b7ae86a0 Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Sun, 13 Nov 2016 14:02:14 -0800 Subject: Basic composite app with uPickle --- build.sbt | 40 +++++++++++++++++++++++++++++----------- 1 file changed, 29 insertions(+), 11 deletions(-) (limited to 'build.sbt') 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 -- cgit v1.2.3