-
Notifications
You must be signed in to change notification settings - Fork 9
/
build.sbt
264 lines (247 loc) · 9.05 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
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
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
inThisBuild(
Seq(
organization := "io.github.azhur",
organizationName := "Artur Zhurat",
organizationHomepage := Some(url("https://github.com/azhur")),
homepage := Some(url("https://github.com/azhur/kafka-serde-scala")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
scmInfo := Some(
ScmInfo(
url("https://github.com/azhur/kafka-serde-scala"),
"[email protected]:azhur/kafka-serde-scala.git"
)
),
developers := List(
Developer(
id = "azhur",
name = "Artur Zhurat",
email = "[email protected]",
url = url("https://twitter.com/a_zhur")
)
)
)
)
lazy val latest212 = "2.12.18"
lazy val latest213 = "2.13.12"
lazy val latest3 = "3.3.1"
lazy val `kafka-serde-scala` =
project
.in(file("."))
.disablePlugins(MimaPlugin)
.aggregate(
`kafka-serde-avro4s`,
`kafka-serde-circe`,
`kafka-serde-jackson`,
`kafka-serde-json4s`,
`kafka-serde-jsoniter-scala`,
`kafka-serde-play-json`,
`kafka-serde-upickle`,
`kafka-serde-scalapb`,
`kafka-serde-zio-json`,
`kafka-serde-scala-example`
)
.settings(commonSettings)
.settings(
Compile / unmanagedSourceDirectories := Seq.empty,
Test / unmanagedSourceDirectories := Seq.empty,
publishArtifact := false
)
lazy val `kafka-serde-circe` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213, latest3),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.circe,
dependency.circeParser,
dependency.circeJawn,
dependency.circeGeneric % Test,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-json4s` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213, latest3),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.json4sCore,
dependency.json4sJackson % Test,
dependency.json4sNative % Test,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-jsoniter-scala` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213, latest3),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.jsoniterScalaCore,
dependency.jsoniterScalaMacros % Test,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-play-json` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.playJson,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-upickle` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213, latest3),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.upickle,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-avro4s` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.avro4sCore,
dependency.avro4sKafka,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-jackson` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.jacksonCore,
dependency.jacksonScala,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
dependency.jacksonProtobuf % Test,
dependency.jacksonAvro % Test,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-scalapb` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213, latest3),
startYear := Some(2021),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.scalaTest % Test
)
)
.settings(
Compile / PB.targets := Seq(
scalapb.gen() -> (Compile / sourceManaged).value / "scalapb"
),
Test / PB.targets := Seq(
scalapb.gen() -> (Test / sourceManaged).value / "scalapb"
)
)
lazy val `kafka-serde-zio-json` = project
.enablePlugins(AutomateHeaderPlugin)
.settings(commonSettings)
.settings(mimaSettings)
.settings(
crossScalaVersions := Seq(latest212, latest213, latest3),
libraryDependencies ++= Seq(
dependency.kafkaClients,
dependency.zioJson,
dependency.scalaTest % Test
)
)
lazy val `kafka-serde-scala-example` = project
.dependsOn(`kafka-serde-circe`)
.enablePlugins(AutomateHeaderPlugin)
.disablePlugins(MimaPlugin)
.settings(commonSettings)
.settings(
publishArtifact := false,
libraryDependencies ++= Seq(
dependency.kafkaStreamsScala,
dependency.circeGeneric,
dependency.scalaTest % Test
)
)
lazy val dependency =
new {
object Version {
val avro4s = "4.1.1"
val circe = "0.14.6"
val json4s = "4.0.7"
val jsoniterScala = "2.28.1"
val scalaTest = "3.2.17"
val kafka = "3.6.1"
val play = "3.0.2"
val upickle = "3.1.4"
val jackson = "2.16.1"
val zioJson = "0.6.2"
}
val kafkaClients = "org.apache.kafka" % "kafka-clients" % Version.kafka
val kafkaStreamsScala = "org.apache.kafka" %% "kafka-streams-scala" % Version.kafka
val avro4sCore = "com.sksamuel.avro4s" %% "avro4s-core" % Version.avro4s
val avro4sKafka = "com.sksamuel.avro4s" %% "avro4s-kafka" % Version.avro4s
val circe = "io.circe" %% "circe-core" % Version.circe
val circeParser = "io.circe" %% "circe-parser" % Version.circe
val circeJawn = "io.circe" %% "circe-jawn" % Version.circe
val circeGeneric = "io.circe" %% "circe-generic" % Version.circe
val json4sCore = "org.json4s" %% "json4s-core" % Version.json4s
val json4sJackson = "org.json4s" %% "json4s-jackson" % Version.json4s
val json4sNative = "org.json4s" %% "json4s-native" % Version.json4s
val jsoniterScalaCore = "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % Version.jsoniterScala
val jsoniterScalaMacros = "com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % Version.jsoniterScala
val playJson = "org.playframework" %% "play-json" % Version.play
val upickle = "com.lihaoyi" %% "upickle" % Version.upickle
val jacksonScala = "com.fasterxml.jackson.module" %% "jackson-module-scala" % Version.jackson
val jacksonCore = "com.fasterxml.jackson.core" % "jackson-core" % Version.jackson
val zioJson = "dev.zio" %% "zio-json" % Version.zioJson
val jacksonProtobuf = "com.fasterxml.jackson.dataformat" % "jackson-dataformat-protobuf" % Version.jackson
val jacksonAvro = "com.fasterxml.jackson.dataformat" % "jackson-dataformat-avro" % Version.jackson
val scalaTest = "org.scalatest" %% "scalatest" % Version.scalaTest
}
lazy val commonSettings =
Seq(
resolvers += "Sonatype OSS Staging".at("https://oss.sonatype.org/content/repositories/staging"),
scalaVersion := latest213,
startYear := Some(2018),
scalacOptions ++= Seq(
"-unchecked",
"-deprecation",
"-Xfatal-warnings",
"-encoding",
"UTF-8"
) ++ (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => Seq("-target:jvm-1.8", "-language:_", "-Ywarn-dead-code", "-Xlint")
case Some((2, 13)) => Seq("-language:_", "-Ywarn-dead-code", "-Xlint", "-Xlint:-byname-implicit")
case _ => Seq.empty
}),
pomIncludeRepository := (_ => false),
scalafmtOnCompile := true
)
lazy val mimaSettings =
Seq(
mimaPreviousArtifacts := previousStableVersion.value.map(organization.value %% name.value % _).toSet
)