-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathbuild.sbt
More file actions
100 lines (84 loc) · 3.42 KB
/
build.sbt
File metadata and controls
100 lines (84 loc) · 3.42 KB
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
def tapirVersion = "1.13.3"
def circeVersion = "0.14.14"
def ScalaVersion = "3.7.2"
def esbuildMain = s"scala-${ScalaVersion}/esbuild/main"
def commonSettings = Seq(
scalaVersion := ScalaVersion,
version := "0.1.0-SNAPSHOT",
organization := "org.openmole.miniclust",
resolvers += "jitpack" at "https://jitpack.io"
)
lazy val server = (project in file("server")).settings(
commonSettings,
Compile / resourceGenerators += Def.taskDyn {
val jsBuild = (frontend / Compile / fastOptJS / esbuildBundle).value
val cssTask = (frontend / Compile / resourceDirectory).map(_ / "style.css")
Def.task {
val cssFile = cssTask.value
val destTarget = target.value / "frontend"
IO.createDirectory(destTarget)
IO.copyFile((frontend / Compile / target).value / s"${esbuildMain}/out/main.js", destTarget / "js/main.js")
IO.copyFile(cssFile, destTarget / "css" / cssFile.getName)
Seq()
}
},
Seq(
name := "manager",
libraryDependencies ++= Seq(
"com.softwaremill.sttp.tapir" %% "tapir-netty-server-sync" % tapirVersion,
"com.softwaremill.sttp.tapir" %% "tapir-swagger-ui-bundle" % tapirVersion,
"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % tapirVersion,
"com.typesafe.slick" %% "slick" % "3.6.1",
"com.h2database" % "h2" % "2.4.240",
"org.slf4j" % "slf4j-nop" % "2.0.17",
"com.softwaremill.ox" %% "core" % "1.0.2",
"io.circe" %% "circe-generic" % circeVersion,
//"ch.qos.logback" % "logback-classic" % "1.5.16",
"com.lihaoyi" %% "scalatags" % "0.13.1",
"ch.epfl.lamp" %% "gears" % "0.2.0",
"com.github.pathikrit" %% "better-files" % "3.9.2",
"com.github.openmole.miniclust" %% "message" % "f07604400d",
"com.github.jwt-scala" %% "jwt-core" % "11.0.0",
//"com.lihaoyi" %% "upickle" % "4.1.0",
"io.github.arainko" %%% "ducktape" % "0.2.10",
"com.github.f4b6a3" % "ulid-creator" % "5.2.3",
"org.apache.commons" % "commons-math3" % "3.6.1",
"com.softwaremill.sttp.tapir" %% "tapir-sttp-stub-server" % tapirVersion % Test,
"org.scalatest" %% "scalatest" % "3.2.19" % Test,
"com.softwaremill.sttp.client3" %% "circe" % "3.10.2" % Test
),
)
) dependsOn (common)
lazy val common = (project in file("common")).enablePlugins(ScalaJSPlugin).settings(
commonSettings,
Seq(
name := "common",
libraryDependencies ++= Seq(
"com.softwaremill.sttp.tapir" %% "tapir-server" % tapirVersion,
"com.softwaremill.sttp.tapir" %% "tapir-json-circe" % tapirVersion
)
)
)
lazy val frontend = (project in file("frontend"))
.enablePlugins(ScalaJSEsbuildPlugin)
.enablePlugins(ScalablyTypedConverterExternalNpmPlugin)
.settings(
commonSettings,
name := "frontend",
libraryDependencies ++= Seq(
"com.softwaremill.sttp.tapir" %%% "tapir-sttp-client4" % tapirVersion,
"com.softwaremill.sttp.tapir" %%% "tapir-json-circe" % tapirVersion,
"com.raquo" %%% "laminar" % "17.2.1",
"io.circe" %%% "circe-generic" % circeVersion,
"io.circe" %%% "circe-parser" % circeVersion
//"io.github.cquiroz" %%% "scala-java-time" % "2.2.0",
// "com.softwaremill.sttp.client3" %%% "circe" % "3.10.2"
),
scalaJSUseMainModuleInitializer := true,
stOutputPackage := "miniclust.facade",
externalNpm := target.value / esbuildMain,
scalaJSLinkerConfig ~= {
_.withModuleKind(ModuleKind.ESModule)
}
)
.dependsOn(common)