-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathbuild.sbt
80 lines (71 loc) · 2.42 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
val scalaV = "3.3.4"
val pekkoV = "1.1.1"
val pekkoHttpV = "1.1.0"
val upickleV = "4.0.2"
val utestV = "0.8.4"
val scalaJsDomV = "2.8.0"
val specs2V = "5.5.3"
lazy val root =
project.in(file("."))
.aggregate(frontend, backend, cli)
// Scala-Js frontend
lazy val frontend =
project.in(file("frontend"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings: _*)
.settings(
scalaJSUseMainModuleInitializer := true,
testFrameworks += new TestFramework("utest.runner.Framework"),
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % scalaJsDomV,
"com.lihaoyi" %%% "utest" % utestV % "test"
)
)
.dependsOn(sharedJs)
// Akka Http based backend
lazy val backend =
project.in(file("backend"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoV,
"org.apache.pekko" %% "pekko-http" % pekkoHttpV,
"org.specs2" %% "specs2-core" % specs2V % "test",
"com.lihaoyi" %% "upickle" % upickleV
),
Compile / resourceGenerators += Def.task {
val f1 = (frontend / Compile / fastOptJS).value.data
Seq(f1, new File(f1.getPath+".map"))
}.taskValue,
watchSources ++= (frontend / watchSources).value
)
.dependsOn(sharedJvm)
lazy val cli =
project.in(file("cli"))
.settings(commonSettings: _*)
.settings(
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoV,
"org.apache.pekko" %% "pekko-http-core" % pekkoHttpV,
"org.specs2" %% "specs2-core" % specs2V % "test",
"com.lihaoyi" %% "upickle" % upickleV
),
run / fork := true,
run / connectInput := true,
assemblyJarName := "../cli.jar"
)
.dependsOn(sharedJvm)
lazy val shared =
(crossProject(JSPlatform, JVMPlatform).crossType(CrossType.Pure) in file ("shared"))
.settings(
scalaVersion := scalaV,
libraryDependencies += "com.lihaoyi" %%% "upickle" % upickleV,
)
lazy val sharedJvm= shared.jvm
lazy val sharedJs= shared.js
def commonSettings = Seq(
scalaVersion := scalaV,
scalacOptions ++= Seq("-deprecation", "-feature", "-encoding", "utf8", "-unchecked", "-Xlint"),
resolvers += "Apache Nexus Snapshots".at("https://repository.apache.org/content/repositories/snapshots/"),
resolvers += "Apache Nexus Staging".at("https://repository.apache.org/content/repositories/staging/"),
)