| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192 |
- def commonSettings = Seq(
- scalaVersion := "2.13.3",
- version := "0.1.0",
- scalacOptions ++= Seq(
- "-deprecation",
- "-unchecked"
- )
- )
- lazy val server: Project = (project in file("server"))
- .settings(commonSettings)
- .settings(
- scalaJSProjects := Seq(client),
- pipelineStages in Assets := Seq(scalaJSPipeline),
- compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
- javaOptions in Test += "-Dconfig.file=conf/testing.conf",
- libraryDependencies ++= Seq(
- guice,
- "codes.reactive" %% "scala-time" % "0.4.2",
- // OAuth
- "com.nulab-inc" %% "scala-oauth2-core" % "1.5.0",
- "com.nulab-inc" %% "play2-oauth2-provider" % "1.5.0",
- "com.github.t3hnar" %% "scala-bcrypt" % "4.3.0",
- // Client Libraries
- "com.vmunier" %% "scalajs-scripts" % "1.1.4",
- "org.webjars" %% "webjars-play" % "2.8.0",
- "org.webjars" % "jquery" % "3.4.1",
- "org.webjars" % "bootstrap" % "4.4.1-1",
- "org.webjars" % "jquery-ui" % "1.12.1",
- "org.webjars.npm" % "sortablejs" % "1.13.0",
- // Mogno + ORM
- "org.mongodb.scala" %% "mongo-scala-driver" % "4.1.0",
- // Testing
- specs2 % Test,
- "org.scalatestplus.play" %% "scalatestplus-play" % "5.0.0" % Test
- )
- )
- .enablePlugins(PlayScala)
- .dependsOn(sharedJvm)
- .dependsOn(fdcJvm)
- import com.tflucke.webroutes.endpoints.PlayEndpointFile
- lazy val client = (project in file("client"))
- .settings(commonSettings)
- .settings(
- scalaJSUseMainModuleInitializer := true,
- libraryDependencies += "org.querki" %%% "jquery-facade" % "2.0",
- libraryDependencies += "in.nvilla" %%% "monadic-html" % "0.4.1",
- libraryDependencies += "in.nvilla" %%% "monadic-rx-cats" % "0.4.1",
- libraryDependencies += "com.tflucke" %%% "typeahead-scala" % "0.2.1",
- libraryDependencies += "com.tflucke" %%% "sortablejs-facade" % "1.13.0",
- scalacOptions ++= {
- import Ordering.Implicits._
- if (VersionNumber(scalaVersion.value).numbers >= Seq(2L, 13L))
- Seq("-Ymacro-annotations")
- else Nil
- }
- )
- .enablePlugins(ScalaJSPlugin, ScalaJSWeb)
- .dependsOn(sharedJs)
- .dependsOn(fdcJs)
- lazy val shared = crossProject(JSPlatform, JVMPlatform)
- .in(file("shared"))
- .settings(commonSettings)
- .settings(
- Compile / apiDefinitions += PlayEndpointFile(server),
- libraryDependencies += "com.typesafe.play" %%% "play-json" % "2.9.2",
- // Temporary workaround due to mongodb limitations
- libraryDependencies += "org.julienrf" %%% "play-json-derived-codecs" % "8.0.0"
- )
- .enablePlugins(RestRPC)
- .jsConfigure(_ enablePlugins ScalaJSWeb)
- lazy val sharedJvm = shared.jvm.dependsOn(fdcJvm).settings(
- libraryDependencies += "org.mongodb.scala" %% "mongo-scala-bson" % "4.1.0"
- )
- lazy val sharedJs = shared.js.dependsOn(fdcJs)
- lazy val fdc = crossProject(JSPlatform, JVMPlatform)
- .in(file("fdc"))
- .settings(commonSettings)
- .settings(
- libraryDependencies += "com.typesafe.play" %% "play-json" % "2.9.2",
- libraryDependencies += "com.tflucke" %%% "rest-rpc" % "0.3.1"
- )
- lazy val fdcJs = fdc.js
- lazy val fdcJvm = fdc.jvm
- // loads the server project at sbt startup
- onLoad in Global := (onLoad in Global).value.andThen(
- state => "project server" :: state
- )
|