-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.sbt
98 lines (85 loc) · 2.89 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
ThisBuild / organization := "se.su.dsv"
ThisBuild / version := "1.0"
ThisBuild / scalaVersion := "3.3.1"
val http4sVersion = "0.23.18"
ThisBuild / libraryDependencySchemes += "org.http4s" %% "http4s-core" % "always"
def http4s(module: String, version: String = http4sVersion): ModuleID = "org.http4s" %% s"http4s-$module" % version
ThisBuild / libraryDependencies ++= Seq(
"javax.servlet" % "javax.servlet-api" % "3.0.1" % "provided",
http4s("blaze-server", "0.23.13"),
http4s("dsl"),
http4s("circe"),
http4s("servlet", "0.23.13"),
http4s("twirl", "0.24.0-M1"),
"org.tpolecat" %% "doobie-core" % "1.0.0-RC2",
"org.tpolecat" %% "doobie-scalatest" % "1.0.0-RC2" % Test,
"com.h2database" % "h2" % "2.1.214" % Test,
"org.slf4j" % "slf4j-simple" % "1.7.22",
"org.flywaydb" % "flyway-core" % "9.16.0",
"org.flywaydb" % "flyway-mysql" % "9.16.0"
)
ThisBuild / scalacOptions ++= Seq(
"-deprecation",
"-encoding", "UTF-8", // yes, this is 2 args
"-feature",
"-language:existentials",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
)
lazy val toker = project.in(file("."))
.dependsOn(core, production, staging, dev)
.aggregate(core, production, staging, dev)
.settings(
Keys.`package` / aggregate := false
)
lazy val core = project.in(file("core"))
.enablePlugins(SbtTwirl)
.settings(
name := "core",
TwirlKeys.templateImports := Seq() // required due to -Xfatal-warnings
)
lazy val production = project.in(file("production"))
.dependsOn(core)
.enablePlugins(WarPlugin)
.settings(
name := "production"
)
lazy val staging = project.in(file("staging"))
.dependsOn(core)
.enablePlugins(WarPlugin)
.enablePlugins(SbtTwirl)
.settings(
name := "staging",
TwirlKeys.templateImports := Seq() // required due to -Xfatal-warnings
)
lazy val dev = project.in(file("dev"))
.dependsOn(staging)
.enablePlugins(JettyPlugin)
.settings(
name := "dev",
Jetty / containerArgs := Seq("--config", "jetty.xml"),
Jetty / containerLibs ++= Seq("org.mariadb.jdbc" % "mariadb-java-client" % "3.1.3"),
watchTriggers ++= Seq(
(core / TwirlKeys.compileTemplates / sourceDirectory).value,
(staging / TwirlKeys.compileTemplates / sourceDirectory).value,
(TwirlKeys.compileTemplates / sourceDirectory).value,
).map(_.toGlob / "**" / "twirl" / "**"),
webappPostProcess := {
webappDir =>
val stagingWebapp = (staging / Compile / webappPrepare / sourceDirectory).value / "webapp"
IO.copyDirectory(stagingWebapp, webappDir)
}
)
lazy val embedded = project.in(file("embedded"))
.dependsOn(core)
.enablePlugins(JettyPlugin)
.settings(
name := "embedded",
webappPostProcess := {
webappDir =>
val stagingWebapp = (staging / Compile / webappPrepare / sourceDirectory).value / "webapp"
IO.copyDirectory(stagingWebapp, webappDir)
}
)