| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112 |
- def commonSettings = Seq(
- scalaVersion := "2.13.3",
- version := "0.1.0",
- scalacOptions ++= Seq(
- "-deprecation",
- "-unchecked",
- "-feature",
- "-Xlint:-unused,_",
- "-Ywarn-unused:imports",
- "-Ywarn-macros:after",
- )
- )
- lazy val server: Project = (project in file("server"))
- .settings(commonSettings)
- .settings(
- scalaJSProjects := Seq(client),
- Assets / pipelineStages := Seq(scalaJSPipeline),
- Compile / compile := ((Compile / compile) dependsOn scalaJSPipeline).value,
- Test / javaOptions += "-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",
- //"com.scalableminds" %% "mongev" % "0.5.0",
- //"com.scalableminds" %% "mongev" % "0.5.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
- import org.scalajs.linker.interface.ModuleInitializer
- lazy val client = (project in file("webClient"))
- .settings(commonSettings)
- .settings(
- //scalaJSMainModuleInitializer := Some(ModuleInitializer.mainMethod("com.weEat.Main", "main").withModuleID("we-eat")),
- scalaJSUseMainModuleInitializer := true,
- libraryDependencies ++= Seq(
- "net.exoego" %%% "scalajs-jquery3" % "2.2.0",
- "com.raquo" %%% "laminar" % "0.14.2",
- "io.laminext" %%% "core" % "0.16.2",
- "com.tflucke" %%% "typeahead-scala" % "0.2.2",
- "com.tflucke" %%% "sortablejs-facade" % "1.13.0",
- "org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0",
- "com.raquo" %%% "waypoint" % "7.0.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).settings(
- libraryDependencies ++= Seq(
- "org.scala-js" %%% "scala-js-macrotask-executor" % "1.0.0",
- "io.github.cquiroz" %%% "scala-java-time" % "2.2.2",
- "io.github.cquiroz" %%% "scala-java-time-tzdb" % "2.2.2",
- )
- )
- 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.2"
- )
- lazy val fdcJs = fdc.js
- lazy val fdcJvm = fdc.jvm
- // loads the server project at sbt startup
- Global / onLoad := (Global / onLoad).value.andThen(
- state => "project server" :: state
- )
|