-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
126 lines (115 loc) · 3.69 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
import sbtcrossproject.CrossPlugin.autoImport.{CrossType, crossProject}
name := "wfit"
ThisBuild / version := "latest-SNAPSHOT"
ThisBuild / scalaVersion := "2.12.6"
val DockerImage = "openjdk:10.0.2-jre-slim"
lazy val commonSettings: Seq[Def.Setting[_]] = Seq(
scalacOptions ++= Seq(
//"-Xlog-implicits",
"-deprecation",
"-unchecked",
"-Xfatal-warnings",
"-feature",
"-language:implicitConversions",
"-language:reflectiveCalls",
"-language:higherKinds",
//"-opt:l:method",
),
sources in (Compile, doc) := Seq.empty,
publishArtifact in (Compile, packageDoc) := false,
publishArtifact in (Compile, packageSrc) := false,
)
lazy val commonScalaJsSettings: Seq[Def.Setting[_]] = Seq(
scalacOptions += "-P:scalajs:sjsDefinedByDefault",
)
lazy val root = project
.in(file("."))
.aggregate(
server,
client,
electron,
sharedJvm,
sharedJs,
)
.settings(
run := { (run in server in Compile).evaluated },
)
lazy val server = (project in file("server"))
.settings(
name := "wfit-server",
commonSettings,
libraryDependencies ++= Seq(
guice,
ehcache,
ws,
"com.vmunier" %% "scalajs-scripts" % "1.1.2",
"org.mindrot" % "jbcrypt" % "0.4",
"com.typesafe.slick" %% "slick" % "3.2.3",
"com.typesafe.play" %% "play-slick" % "3.0.3",
"org.mariadb.jdbc" % "mariadb-java-client" % "2.2.6",
"org.ocpsoft.prettytime" % "prettytime" % "4.0.2.Final",
"com.google.javascript" % "closure-compiler" % "v20180506",
),
scalaJSProjects := Seq(client, electron),
pipelineStages in Assets := Seq(scalaJSPipeline),
pipelineStages := Seq(digest, gzip),
compile in Compile := ((compile in Compile) dependsOn scalaJSPipeline).value,
DigestKeys.indexPath := Some("javascripts/versioned.js"),
DigestKeys.indexWriter ~= (writer => index => s"var versioned = ${writer(index)};"),
TwirlKeys.templateImports ++= Seq(
"_root_.base._",
"_root_.utils._",
"_root_.models.UUID",
),
PlayKeys.fileWatchService := play.dev.filewatch.FileWatchService.polling(500),
fork := true,
dockerBaseImage := DockerImage
)
.enablePlugins(PlayScala, DockerPlugin)
.dependsOn(sharedJvm)
lazy val client = (project in file("client"))
.settings(
name := "wfit-client",
commonSettings,
commonScalaJsSettings,
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= Seq(
"in.nvilla" %%% "monadic-html" % "0.3.2",
),
jsDependencies ++= Seq(
),
skip in packageJSDependencies := false,
)
.enablePlugins(ScalaJSPlugin, ScalaJSWeb, JSDependenciesPlugin)
.dependsOn(sharedJs)
lazy val electron = (project in file("electron"))
.settings(
name := "wfit-electron",
commonSettings,
commonScalaJsSettings,
scalaJSUseMainModuleInitializer := true,
)
.enablePlugins(ScalaJSPlugin, ScalaJSWeb)
.dependsOn(sharedJs)
lazy val shared = (crossProject(JSPlatform, JVMPlatform).crossType(CrossType.Full) in file("shared"))
.settings(
name := "shared",
commonSettings,
libraryDependencies ++= Seq(
"com.typesafe.play" %%% "play-json" % "2.6.10",
)
)
.jsSettings(
commonScalaJsSettings,
libraryDependencies ++= Seq(
"io.github.cquiroz" %%% "scala-java-time" % "2.0.0-M13",
"org.scala-js" %%% "scalajs-dom" % "0.9.6",
// "org.akka-js" %%% "akkajsactor" % "1.2.5.15",
// "org.akka-js" %%% "akkajsactorstream" % "1.2.5.15",
)
)
.jvmSettings(
libraryDependencies += "org.scala-js" %% "scalajs-stubs" % "0.6.24" % "provided",
)
lazy val sharedJvm = shared.jvm
lazy val sharedJs = shared.js