-
Notifications
You must be signed in to change notification settings - Fork 33
Expand file tree
/
Copy pathbuild.sbt
More file actions
151 lines (139 loc) · 4.85 KB
/
build.sbt
File metadata and controls
151 lines (139 loc) · 4.85 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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings
import com.softwaremill.Publish.{ossPublishSettings, updateDocs}
import com.softwaremill.UpdateVersionInDocs
import com.typesafe.tools.mima.core.{MissingClassProblem, ProblemFilters}
lazy val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq(
organization := "com.softwaremill.ox",
scalaVersion := "3.3.7",
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",
mimaPreviousArtifacts := Set.empty // we only use MiMa for `core` for now, using enableMimaSettings
)
val enableMimaSettings = Seq(
mimaPreviousArtifacts := {
val current = version.value
val isRcOrMilestone = current.contains("M") || current.contains("RC")
if (!isRcOrMilestone) {
val previous = previousStableVersion.value
println(s"[info] Not a M or RC version, using previous version for MiMa check: $previous")
previousStableVersion.value.map(organization.value %% moduleName.value % _).toSet
} else {
println(s"[info] $current is an M or RC version, no previous version to check with MiMa")
Set.empty
}
},
mimaBinaryIssueFilters ++= Seq(
// GroupingTimeout is only ever used within the groupWithin method, never exposed externally
ProblemFilters.exclude[MissingClassProblem]("ox.flow.FlowOps$GroupingTimeout$")
)
)
val scalaTest = "org.scalatest" %% "scalatest" % "3.2.20" % Test
val slf4j = "org.slf4j" % "slf4j-api" % "2.0.17"
val logback = "ch.qos.logback" % "logback-classic" % "1.5.32"
// 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, kafka, mdcLogback, flowReactiveStreams, cron, otelContext)
lazy val core: Project = (project in file("core"))
.settings(commonSettings)
.settings(
name := "core",
libraryDependencies ++= Seq(
"com.softwaremill.jox" % "channels" % "1.1.2",
scalaTest,
"org.apache.pekko" %% "pekko-stream" % "1.5.0" % Test,
"org.reactivestreams" % "reactive-streams-tck-flow" % "1.0.4" % Test
),
Test / fork := true
)
.settings(enableMimaSettings)
lazy val kafka: Project = (project in file("kafka"))
.settings(commonSettings)
.settings(
name := "kafka",
libraryDependencies ++= Seq(
"org.apache.kafka" % "kafka-clients" % "4.2.0",
slf4j,
logback % Test,
"io.github.embeddedkafka" %% "embedded-kafka" % "4.2.0" % Test,
"org.apache.pekko" %% "pekko-connectors-kafka" % "1.1.0" % Test,
"org.apache.pekko" %% "pekko-stream" % "1.5.0" % 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 cron: Project = (project in file("cron"))
.settings(commonSettings)
.settings(
name := "cron",
libraryDependencies ++= Seq(
"com.github.alonsodomin.cron4s" %% "cron4s-core" % "0.8.2",
scalaTest
)
)
.dependsOn(core % "test->test;compile->compile")
lazy val otelContext: Project = (project in file("otel-context"))
.settings(commonSettings)
.settings(
name := "otel-context",
libraryDependencies ++= Seq(
"io.opentelemetry" % "opentelemetry-api" % "1.61.0",
scalaTest
)
)
.dependsOn(core % "test->test;compile->compile")
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,
cron,
otelContext
)