-
Notifications
You must be signed in to change notification settings - Fork 28
/
build.sbt
117 lines (107 loc) · 3.52 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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings
import com.softwaremill.Publish.{ossPublishSettings, updateDocs}
import com.softwaremill.UpdateVersionInDocs
lazy val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
organization := "com.softwaremill.ox",
scalaVersion := "3.3.4",
updateDocs := Def.taskDyn {
val files1 = UpdateVersionInDocs(sLog.value, organization.value, version.value)
Def.task {
(documentation / mdoc).toTask("").value
files1 ++ Seq(file("generated-doc/out"))
}
}.value,
Test / scalacOptions += "-Wconf:msg=unused value of type org.scalatest.Assertion:s",
Test / scalacOptions += "-Wconf:msg=unused value of type org.scalatest.compatible.Assertion:s"
)
val scalaTest = "org.scalatest" %% "scalatest" % "3.2.19" % Test
val slf4j = "org.slf4j" % "slf4j-api" % "2.0.16"
val logback = "ch.qos.logback" % "logback-classic" % "1.5.12"
// used during CI to verify that the documentation compiles
val compileDocumentation: TaskKey[Unit] = taskKey[Unit]("Compiles documentation throwing away its output")
compileDocumentation := {
(documentation / mdoc).toTask(" --out target/ox-doc").value
}
lazy val rootProject = (project in file("."))
.settings(commonSettings)
.settings(publishArtifact := false, name := "ox")
.aggregate(core, examples, kafka, mdcLogback, flowReactiveStreams)
lazy val core: Project = (project in file("core"))
.settings(commonSettings)
.settings(
name := "core",
libraryDependencies ++= Seq(
"com.softwaremill.jox" % "channels" % "0.3.1",
scalaTest,
"org.apache.pekko" %% "pekko-stream" % "1.1.2" % Test,
"org.reactivestreams" % "reactive-streams-tck-flow" % "1.0.4" % Test
),
Test / fork := true
)
lazy val examples: Project = (project in file("examples"))
.settings(commonSettings)
.settings(
name := "examples",
libraryDependencies ++= Seq(
logback % Test,
scalaTest
),
publishArtifact := false
)
.dependsOn(core)
lazy val kafka: Project = (project in file("kafka"))
.settings(commonSettings)
.settings(
name := "kafka",
libraryDependencies ++= Seq(
"org.apache.kafka" % "kafka-clients" % "3.8.0",
slf4j,
logback % Test,
"io.github.embeddedkafka" %% "embedded-kafka" % "3.9.0" % Test,
"org.apache.pekko" %% "pekko-connectors-kafka" % "1.1.0" % Test,
"org.apache.pekko" %% "pekko-stream" % "1.1.2" % Test,
scalaTest
)
)
.dependsOn(core)
lazy val mdcLogback: Project = (project in file("mdc-logback"))
.settings(commonSettings)
.settings(
name := "mdc-logback",
libraryDependencies ++= Seq(
logback,
scalaTest
)
)
.dependsOn(core)
lazy val flowReactiveStreams: Project = (project in file("flow-reactive-streams"))
.settings(commonSettings)
.settings(
name := "flow-reactive-streams",
libraryDependencies ++= Seq(
"org.reactivestreams" % "reactive-streams" % "1.0.4",
scalaTest
)
)
.dependsOn(core)
lazy val documentation: Project = (project in file("generated-doc")) // important: it must not be doc/
.enablePlugins(MdocPlugin)
.settings(commonSettings)
.settings(
mdocIn := file("doc"),
moduleName := "ox-doc",
mdocVariables := Map(
"VERSION" -> version.value
),
mdocOut := file("generated-doc/out"),
mdocExtraArguments := Seq("--clean-target"),
publishArtifact := false,
name := "doc",
libraryDependencies ++= Seq(logback % Test)
)
.dependsOn(
core,
kafka,
mdcLogback,
flowReactiveStreams
)