generated from MarkCLewis/play-scalajs-slinky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
74 lines (66 loc) · 2.78 KB
/
build.sbt
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
import sbtcrossproject.{crossProject, CrossType}
enablePlugins(JavaAppPackaging)
Global / onChangedBuildSource := ReloadOnSourceChanges
lazy val server = (project in file("server")).settings(commonSettings).settings(
name := "play-server",
version := "0.1.0",
scalacOptions += "-Xasync",
scalaJSProjects := Seq(client),
Assets / pipelineStages := Seq(scalaJSPipeline),
pipelineStages := Seq(digest, gzip),
// triggers scalaJSPipeline when using compile or continuous compilation
Compile / compile := ((Compile / compile) dependsOn scalaJSPipeline).value,
libraryDependencies ++= Seq(
"com.vmunier" %% "scalajs-scripts" % "1.2.0",
"com.google.inject" % "guice" % "6.0.0",
"com.google.inject.extensions" % "guice-assistedinject" % "6.0.0",
guice,
"org.scalatestplus.play" %% "scalatestplus-play" % "7.0.1" % Test,
"org.playframework" %% "play-slick" % "6.0.0",
"com.typesafe.slick" %% "slick-codegen" % "3.4.1",
"mysql" % "mysql-connector-java" % "8.0.33",
//^^ i think this is right? from slick website
"org.mindrot" % "jbcrypt" % "0.4",
"com.typesafe.slick" %% "slick-hikaricp" % "3.4.1",
"org.scala-lang.modules" %% "scala-async" % "1.0.1",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided,
specs2 % Test
),
Test / javaOptions ++= Seq(
"--add-exports=java.base/sun.security.x509=ALL-UNNAMED",
"--add-opens=java.base/sun.security.ssl=ALL-UNNAMED" // Could be needed as well in some cases
),
).enablePlugins(PlayScala).
dependsOn(sharedJvm)
lazy val client = (project in file("client")).settings(commonSettings).settings(
name := "play-client",
scalacOptions += "-Ymacro-annotations",
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % "2.8.0",
"me.shadaj" %%% "slinky-core" % "0.7.4",
"me.shadaj" %%% "slinky-web" % "0.7.4",
"com.google.inject" % "guice" % "4.2.3",
"com.google.inject.extensions" % "guice-assistedinject" % "4.2.3",
"org.scalatestplus.play" %% "scalatestplus-play" % "5.1.0" % Test,
"org.scala-lang.modules" %% "scala-async" % "1.0.1",
"org.scala-lang" % "scala-reflect" % scalaVersion.value % Provided
)
).enablePlugins(ScalaJSPlugin, ScalaJSWeb).
dependsOn(sharedJs)
lazy val shared = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("shared"))
.settings(commonSettings)
.settings(
name := "play-shared"
)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js
lazy val commonSettings = Seq(
scalaVersion := "2.13.12",
organization := "edu.trinity",
libraryDependencies += "org.playframework" %% "play-json" % "3.0.2"
)
// loads the server project at sbt startup
onLoad in Global := (onLoad in Global).value andThen {s: State => "project server" :: s}