-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathbuild.sbt
More file actions
215 lines (199 loc) · 6.54 KB
/
Copy pathbuild.sbt
File metadata and controls
215 lines (199 loc) · 6.54 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
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
import Dependencies.*
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / evictionErrorLevel := Level.Warn
ThisBuild / versionPolicyIntention := Compatibility.None
lazy val Scala3Version = "3.3.8"
lazy val Scala2Version = "2.13.18"
lazy val commonSettings = Seq(
organization := "com.evolutiongaming",
homepage := Some(url("https://github.com/evolution-gaming/kafka-flow")),
startYear := Some(2019),
organizationName := "Evolution Gaming",
organizationHomepage := Some(url("https://evolution.com/")),
publishTo := Some(Resolver.evolutionReleases),
crossScalaVersions := Seq(Scala2Version, Scala3Version),
scalaVersion := crossScalaVersions.value.head,
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))),
testFrameworks += new TestFramework("munit.Framework"),
testOptions += Tests.Argument(new TestFramework("munit.Framework"), "+l"),
libraryDependencySchemes ++= Seq(
"org.scala-lang.modules" %% "scala-java8-compat" % "always"
),
libraryDependencies ++= crossSettings(
scalaVersion.value,
if3 = Nil,
if2 = List(compilerPlugin("org.typelevel" %% "kind-projector" % "0.13.4" cross CrossVersion.full)),
),
scalacOptions ++= crossSettings(
scalaVersion.value,
if3 = List("-Ykind-projector", "-language:implicitConversions", "-explain", "-deprecation"),
if2 = List("-Xsource:3")
),
)
def crossSettings[T](scalaVersion: String, if3: List[T], if2: List[T]) =
CrossVersion.partialVersion(scalaVersion) match {
case Some((3, _)) => if3
case Some((2, 12 | 13)) => if2
case _ => Nil
}
lazy val root = (project in file("."))
.aggregate(
core,
`core-it-tests`,
`persistence-cassandra`,
`persistence-cassandra-it-tests`,
`persistence-kafka`,
`persistence-kafka-it-tests`,
metrics,
journal,
)
.settings(commonSettings)
.settings(
name := "kafka-flow",
publish / skip := true,
crossScalaVersions := Nil,
scalaVersion := Scala2Version,
)
// Vendored fork of skafka 20.2.0 (sources under lib/skafka), used instead of the published artifact so the
// experimental `group.protocol=consumer` (KIP-848) support added to ConsumerConfig is reproducible from source
// without an upstream release. Only the fork differs from upstream; the rest of skafka is verbatim.
lazy val skafka = (project in file("lib/skafka"))
.settings(commonSettings)
.settings(
name := "skafka",
// skafka's own build does the same: its sources carry deprecations (e.g. a kafka-clients 4.2-deprecated
// constructor) that upstream intentionally does not fail the build on
scalacOptsFailOnWarn := Some(false),
libraryDependencies ++= Seq(
Cats.core,
Cats.effect,
"org.typelevel" %% "cats-effect-std" % "3.7.0",
"com.evolutiongaming" %% "config-tools" % "1.0.5",
"org.apache.kafka" % "kafka-clients" % "4.3.0",
"com.evolutiongaming" %% "future-helper" % "1.0.7",
catsHelper,
smetrics,
"org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2",
"org.scala-lang.modules" %% "scala-collection-compat" % "2.14.0",
),
)
lazy val core = (project in file("core"))
.dependsOn(skafka)
.settings(commonSettings)
.settings(
name := "kafka-flow",
libraryDependencies ++= Seq(
Cats.core,
Cats.mtl,
Cats.effect,
Cats.effectTestkit % Test,
Monocle.`macro` % Test,
Monocle.core % Test,
catsHelper,
scache,
sstream,
random,
retry,
Scodec.bits,
Testing.munit % Test,
),
libraryDependencies ++= crossSettings(
scalaVersion.value,
if3 = List(Scodec.coreScala3),
if2 = List(Scodec.coreScala213)
),
)
lazy val `core-it-tests` = (project in file("core-it-tests"))
.dependsOn(core)
.settings(commonSettings)
.settings(
name := "kafka-flow-core-it-tests",
libraryDependencies ++= Seq(
Testing.munit % Test,
Testing.Testcontainers.kafka % Test,
Testing.Testcontainers.munit % Test,
),
Test / fork := true,
publish / skip := true,
)
lazy val metrics = (project in file("metrics"))
.dependsOn(core)
.settings(commonSettings)
.settings(
name := "kafka-flow-metrics",
libraryDependencies ++= Seq(
smetrics,
Testing.munit % Test,
),
)
lazy val `persistence-cassandra` = (project in file("persistence-cassandra"))
.dependsOn(core)
.settings(commonSettings)
.settings(
name := "kafka-flow-persistence-cassandra",
libraryDependencies ++= Seq(
scassandra,
cassandraSync,
),
libraryDependencies ++= crossSettings(
scalaVersion.value,
if3 = List(PureConfig.GenericScala3),
if2 = Nil,
),
)
lazy val `persistence-cassandra-it-tests` = (project in file("persistence-cassandra-it-tests"))
.dependsOn(`persistence-cassandra`)
.settings(commonSettings)
.settings(
name := "kafka-flow-persistence-cassandra-it-tests",
libraryDependencies ++= Seq(
Testing.munit % Test,
Testing.Testcontainers.cassandra % Test,
Testing.Testcontainers.munit % Test
),
Test / fork := true,
publish / skip := true,
)
lazy val `persistence-kafka` = (project in file("persistence-kafka"))
.dependsOn(core, metrics)
.settings(commonSettings)
.settings(
name := "kafka-flow-persistence-kafka",
libraryDependencies ++= Seq(
Cats.effectTestkit % Test,
Testing.munit % Test,
),
)
lazy val `persistence-kafka-it-tests` = (project in file("persistence-kafka-it-tests"))
.dependsOn(`persistence-kafka`)
.settings(commonSettings)
.settings(
name := "kafka-flow-persistence-kafka-it-tests",
libraryDependencies ++= Seq(
catsHelperLogback % Test,
playJsonJsoniter % Test,
Testing.munit % Test,
Testing.Testcontainers.kafka % Test,
Testing.Testcontainers.munit % Test,
),
Test / fork := true,
publish / skip := true,
)
lazy val journal = (project in file("kafka-journal"))
.dependsOn(core)
.settings(commonSettings)
.settings(
name := "kafka-flow-kafka-journal",
libraryDependencies ++= Seq(
KafkaJournal.journal,
Testing.munit % Test,
),
)
lazy val docs = (project in file("kafka-flow-docs"))
.dependsOn(core, `persistence-cassandra`, `persistence-kafka`, metrics)
.settings(commonSettings)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
.settings(
scalacOptions -= "-Xfatal-warnings",
)
addCommandAlias("check", "versionPolicyCheck")