-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
80 lines (67 loc) · 2.23 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
name := "sudoku"
ThisBuild / scalaVersion := "3.2.1"
ThisBuild / scalacOptions ++= Seq("-feature", "-deprecation")
ThisBuild / fork := true
// projects
lazy val root = project
.in(file("."))
.aggregate(model.js, frontend, `service-worker`)
lazy val model = crossProject(JSPlatform, JVMPlatform)
.crossType(CrossType.Pure)
.in(file("model"))
.settings(monocle, scalatest)
lazy val frontend = project
.in(file("frontend"))
.dependsOn(model.js)
.enablePlugins(ScalaJSPlugin)
.settings(
scalaJSUseMainModuleInitializer := true,
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.ESModule)
}
)
.settings(monocle, scalatest, snabbdom, circe)
val `service-worker` = project
.in(file("service-worker"))
.enablePlugins(ScalaJSPlugin)
.settings(scalaJSUseMainModuleInitializer := true)
.enablePlugins(BuildInfoPlugin)
.settings(
buildInfoKeys := Seq(
BuildInfoKey.action("buildTime") { System.currentTimeMillis },
BuildInfoKey.action("assetFiles") { sys.env.getOrElse("ASSET_FILES", "") }
)
)
.settings(scalaJsDom)
val analytics = project
.in(file("analytics"))
.dependsOn(model.jvm)
// dependencies
def monocle = {
val version = "3.2.0"
libraryDependencies ++= Seq(
"dev.optics" %%% "monocle-core" % version,
"dev.optics" %%% "monocle-macro" % version
)
}
def circe = {
val version = "0.14.1"
libraryDependencies ++= Seq(
"io.circe" %%% "circe-core" % version,
"io.circe" %%% "circe-generic" % version,
"io.circe" %%% "circe-parser" % version
)
}
def scalatest =
Seq(
libraryDependencies += "org.scalatest" %%% "scalatest" % "3.2.14" % Test,
testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oD")
)
def scalaJsDom =
libraryDependencies += "org.scala-js" %%% "scalajs-dom" % "2.4.0"
def snabbdom = Seq(
resolvers += "jitpack" at "https://jitpack.io",
libraryDependencies += "com.github.gregor-i.scalajs-snabbdom" %%% "scalajs-snabbdom" % "1.3.0" cross CrossVersion.for3Use2_13,
libraryDependencies += "com.github.gregor-i.scalajs-snabbdom" %%% "snabbdom-toasts" % "1.3.0" cross CrossVersion.for3Use2_13,
libraryDependencies += "com.github.gregor-i.scalajs-snabbdom" %%% "snabbdom-components" % "1.3.0" cross CrossVersion.for3Use2_13
)