-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.sbt
94 lines (83 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
val zioVersion = "1.0.18"
val zioCatsVersion = "3.2.9.1"
val http4sVersion = "0.23.15"
val circeVersion = "0.14.5"
val sttpClientVersion = "3.4.2"
lazy val commonSettings = Seq(
organization := "org.phenoscape",
version := "0.2.5",
licenses := Seq("MIT license" -> url("https://opensource.org/licenses/MIT")),
scalaVersion := "2.13.11",
scalacOptions := Seq("-unchecked", "-deprecation", "-encoding", "utf8", "-Ypatmat-exhaust-depth", "off")
)
lazy val parentProject = project.in(file("."))
.settings(commonSettings)
.settings(
name := "phenoscape-kb-ui-project",
(publish / skip) := true)
.aggregate(
webUI,
webServer
)
lazy val webUI = project.in(file("ui"))
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(
name := "phenoscape-kb-ui",
scalaJSUseMainModuleInitializer := true,
libraryDependencies ++= {
Seq(
"com.raquo" %%% "laminar" % "0.14.5",
"com.raquo" %%% "waypoint" % "0.5.0",
"com.lihaoyi" %%% "upickle" % "1.5.0",
"io.circe" %%% "circe-core" % circeVersion,
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion,
"com.softwaremill.sttp.client3" %%% "core" % sttpClientVersion,
"com.softwaremill.sttp.client3" %%% "circe" % sttpClientVersion,
"org.scala-js" %%% "scala-js-macrotask-executor" % "1.1.1"
)
}
)
lazy val webServer = project.in(file("server"))
.enablePlugins(JavaAppPackaging, DockerPlugin)
.settings(commonSettings)
.settings(dockerSettings)
.settings(
name := "phenoscape-kb-ui-server",
libraryDependencies ++= {
Seq(
"dev.zio" %% "zio" % zioVersion,
"dev.zio" %% "zio-interop-cats" % zioCatsVersion,
"org.http4s" %% "http4s-blaze-server" % http4sVersion,
"org.http4s" %% "http4s-dsl" % http4sVersion,
"com.outr" %% "scribe-slf4j" % "3.7.1"
)
}
)
lazy val dockerSettings = Seq(
Docker / packageName := "phenoscape-kb-web-ui",
dockerUsername := Some("phenoscape"),
dockerExposedPorts := Seq(8080),
dockerBuildxPlatforms := Seq("linux/arm64/v8", "linux/amd64")
)
val jsPath = "server/src/main/resources/js"
lazy val fastOptCompileCopy = taskKey[Unit]("")
fastOptCompileCopy := {
val source = (webUI / Compile / fastOptJS).value.data
IO.copyFile(
source,
baseDirectory.value / jsPath / "app.js"
)
}
lazy val fullOptCompileCopy = taskKey[Unit]("")
fullOptCompileCopy := {
val source = (webUI / Compile / fullOptJS).value.data
IO.copyFile(
source,
baseDirectory.value / jsPath / "app.js"
)
}
addCommandAlias("runDev", ";fastOptCompileCopy; webServer/reStart")
addCommandAlias("runProd", ";fullOptCompileCopy; webServer/reStart")
addCommandAlias("publishDocker", ";fullOptCompileCopy; webServer/docker:publish")