-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathbuild.sbt
More file actions
117 lines (106 loc) · 3.42 KB
/
Copy pathbuild.sbt
File metadata and controls
117 lines (106 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import smithy4s.codegen.Smithy4sCodegenPlugin
// Dependencies versions.
val catsVersion = "2.13.0"
val catsEffectVersion = "3.7.0"
val fs2Version = "3.13.0"
val http4sVersion = "0.23.34"
val cirisVersion = "3.14.1"
val skunkVersion = "1.0.0"
val dumboVersion = "0.9.0"
val testcontainersVersion = "0.44.1"
val weaverVersion = "0.12.0"
// Global settings.
ThisBuild / scalaVersion := "3.8.3"
ThisBuild / organization := "co.edu.eafit.dis"
// Common settings.
lazy val commonSettings = Seq(
// Ensure we publish an artifact linked to the appropriate Java std library.
scalacOptions += "-java-output-version:21",
// Make all warnings verbose.
scalacOptions += "-Wconf:any:verbose",
// Base dependencies.
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-core" % catsVersion,
"org.typelevel" %% "cats-effect" % catsEffectVersion,
"co.fs2" %% "fs2-core" % fs2Version,
"co.fs2" %% "fs2-io" % fs2Version
),
// Enable Scalafix in CI.
semanticdbEnabled := true,
semanticdbVersion := scalafixSemanticdb.revision
)
// Assembly merge strategy.
ThisBuild / assemblyMergeStrategy := {
case PathList("META-INF", "smithy", _*) =>
MergeStrategy.concat
case path if path.endsWith("module-info.class") =>
MergeStrategy.concat
case x =>
val oldStrategy = (ThisBuild / assemblyMergeStrategy).value
oldStrategy(x)
}
lazy val domain =
project
.in(file("modules/domain"))
.enablePlugins(Smithy4sCodegenPlugin)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-core" % http4sVersion,
"com.disneystreaming.smithy4s" %% "smithy4s-core" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %% "smithy4s-json" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %% "smithy4s-http4s" % smithy4sVersion.value,
"com.disneystreaming.smithy4s" %% "smithy4s-http4s-swagger" % smithy4sVersion.value
)
)
lazy val server =
project
.in(file("modules/server"))
.dependsOn(domain)
.settings(commonSettings)
.settings(
run / fork := true,
assembly / assemblyJarName := "todo-service.jar",
libraryDependencies ++= Seq(
"is.cir" %% "ciris" % cirisVersion,
"is.cir" %% "ciris-http4s" % cirisVersion,
"org.tpolecat" %% "skunk-core" % skunkVersion,
"dev.rolang" %% "dumbo" % dumboVersion,
"org.http4s" %% "http4s-server" % http4sVersion,
"org.http4s" %% "http4s-ember-server" % http4sVersion
)
)
lazy val client =
project
.in(file("modules/client"))
.dependsOn(domain)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"org.http4s" %% "http4s-client" % http4sVersion,
"org.http4s" %% "http4s-ember-client" % http4sVersion
)
)
lazy val tests =
project
.in(file("modules/tests"))
.dependsOn(server, client)
.settings(commonSettings)
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "weaver-cats" % weaverVersion,
"org.typelevel" %% "weaver-scalacheck" % weaverVersion,
"com.dimafeng" %% "testcontainers-scala-core" % testcontainersVersion,
"com.dimafeng" %% "testcontainers-scala-postgresql" % testcontainersVersion
).map(_ % Test),
testFrameworks += TestFrameworks.WeaverTestCats,
Test / fork := true
)
lazy val root =
project
.in(file("."))
.aggregate(
domain,
server,
tests
)