-
Notifications
You must be signed in to change notification settings - Fork 17
/
build.sbt
223 lines (208 loc) · 7.36 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
import sbtrelease.ExtraReleaseCommands
import sbtrelease.ReleaseStateTransformations._
import sbtrelease.tagsonly.TagsOnly._
lazy val catsVersion = "2.10.0"
lazy val circeVersion = "0.14.6"
lazy val logbackVersion = "1.4.11"
lazy val avro4sVersion = "1.9.0"
lazy val avro4s2Version = "2.0.4"
lazy val json4sVersion = "3.6.12"
lazy val slf4jVersion = "1.7.36"
lazy val sprayJsonVersion = "1.3.6"
lazy val kafkaClientVersion = "3.5.1"
lazy val jsoninterScalaVersion = "1.2.0"
lazy val confluentPlatformVersion = "5.3.8"
lazy val scalaTestVersion = "3.0.9"
lazy val scalaCheckVersion = "1.17.0"
lazy val scalaMockVersion = "3.6.0"
lazy val wiremockVersion = "2.35.1"
lazy val scalaArmVersion = "2.0"
lazy val publicArtifactory = "Artifactory Realm" at "https://kaluza.jfrog.io/artifactory/maven"
lazy val publishSettings = Seq(
publishTo := Some(publicArtifactory),
credentials += {
for {
usr <- sys.env.get("ARTIFACTORY_USER")
password <- sys.env.get("ARTIFACTORY_PASS")
} yield Credentials("Artifactory Realm", "kaluza.jfrog.io", usr, password)
}.getOrElse(Credentials(Path.userHome / ".ivy2" / ".credentials")),
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
releaseStepCommand(ExtraReleaseCommands.initialVcsChecksCommand),
setVersionFromTags(releaseTagPrefix.value),
runClean,
tagRelease,
publishArtifacts,
pushTagsOnly
)
)
lazy val `kafka-serialization` = project
.in(file("."))
.aggregate(avro, avro4s, avro4s2, cats, circe, core, json4s, `jsoniter-scala`, spray, testkit, doc)
.settings(
inThisBuild(
List(
organization := "com.ovoenergy",
organizationName := "OVO Energy",
organizationHomepage := Some(url("https://www.ovoenergy.com/")),
homepage := Some(url("https://github.com/ovotech/kafka-serialization")),
startYear := Some(2017),
licenses := Seq(("Apache-2.0", url("http://www.apache.org/licenses/LICENSE-2.0"))),
scmInfo := Some(
ScmInfo(
url("https://github.com/ovotech/kafka-serialization"),
"git@github.com:ovotech/kafka-serialization.git"
)
),
// TODO Find a way to extract those from github (sbt plugin)
developers := List(
Developer(
"filippo.deluca",
"Filippo De Luca",
"filippo.deluca@ovoenergy.com",
url("https://github.com/filosganga")
)
),
scalaVersion := "2.12.18",
resolvers ++= Seq(
Resolver.mavenLocal,
Resolver.typesafeRepo("releases"),
"confluent-release" at "https://packages.confluent.io/maven/",
"redhat-ga" at "https://maven.repository.redhat.com/ga/"
)
)
)
)
.settings(name := "kafka-serialization", publishArtifact := false, publish := {})
.settings(publishSettings)
lazy val doc = project
.in(file("doc"))
.enablePlugins(MdocPlugin)
.dependsOn(avro, avro4s, cats, circe, core, json4s, `jsoniter-scala`, spray)
.settings(
name := "kafka-serialization-doc",
publishArtifact := false,
publish := {},
mdocIn := baseDirectory.value / "src",
mdocOut := (baseDirectory.value).getParentFile,
libraryDependencies ++= Seq(
"io.circe" %% "circe-generic" % circeVersion,
"org.apache.kafka" % "kafka-clients" % kafkaClientVersion exclude ("org.slf4j", "slf4j-log4j12"),
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoninterScalaVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoninterScalaVersion % Provided
)
)
.settings(publishSettings)
lazy val testkit = project
.in(file("testkit"))
.settings(
name := "kafka-serialization-testkit",
libraryDependencies ++= Seq(
"org.scalatest" %% "scalatest" % scalaTestVersion,
"org.scalacheck" %% "scalacheck" % scalaCheckVersion,
"org.scalamock" %% "scalamock-scalatest-support" % scalaMockVersion,
"com.github.tomakehurst" % "wiremock-jre8" % wiremockVersion,
"com.jsuereth" %% "scala-arm" % scalaArmVersion,
"org.slf4j" % "log4j-over-slf4j" % slf4jVersion,
"org.slf4j" % "jcl-over-slf4j" % slf4jVersion,
"ch.qos.logback" % "logback-core" % logbackVersion,
"ch.qos.logback" % "logback-classic" % logbackVersion
)
)
.settings(publishSettings)
lazy val json4s = project
.in(file("json4s"))
.dependsOn(core, testkit % Test)
.settings(
name := "kafka-serialization-json4s",
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"org.json4s" %% "json4s-core" % json4sVersion,
"org.json4s" %% "json4s-native" % json4sVersion
)
)
.settings(publishSettings)
lazy val avro = project
.in(file("avro"))
.dependsOn(core, testkit % Test)
.settings(
name := "kafka-serialization-avro",
libraryDependencies ++= Seq(
"io.confluent" % "kafka-avro-serializer" % confluentPlatformVersion exclude ("org.slf4j", "slf4j-log4j12")
)
)
.settings(publishSettings)
lazy val avro4s = project
.in(file("avro4s"))
.dependsOn(core, avro, testkit % Test)
.settings(
name := "kafka-serialization-avro4s",
libraryDependencies ++= Seq(
"com.sksamuel.avro4s" %% "avro4s-macros" % avro4sVersion,
"com.sksamuel.avro4s" %% "avro4s-core" % avro4sVersion,
"com.sksamuel.avro4s" %% "avro4s-json" % avro4sVersion
)
)
.settings(publishSettings)
lazy val avro4s2 = project
.in(file("avro4s2"))
.dependsOn(core, avro, testkit % Test)
.settings(
name := "kafka-serialization-avro4s2",
libraryDependencies ++= Seq(
"com.sksamuel.avro4s" %% "avro4s-macros" % avro4s2Version,
"com.sksamuel.avro4s" %% "avro4s-core" % avro4s2Version,
"com.sksamuel.avro4s" %% "avro4s-json" % avro4s2Version
)
)
.settings(publishSettings)
lazy val `jsoniter-scala` = project
.in(file("jsoniter-scala"))
.dependsOn(core, testkit % Test)
.settings(
name := "kafka-serialization-jsoniter-scala",
libraryDependencies ++= Seq(
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-core" % jsoninterScalaVersion,
"com.github.plokhotnyuk.jsoniter-scala" %% "jsoniter-scala-macros" % jsoninterScalaVersion % Provided
)
)
.settings(publishSettings)
lazy val circe = project
.in(file("circe"))
.dependsOn(core, testkit % Test)
.settings(
name := "kafka-serialization-circe",
libraryDependencies ++= Seq(
"io.circe" %% "circe-core" % circeVersion,
"io.circe" %% "circe-parser" % circeVersion,
"io.circe" %% "circe-generic" % circeVersion % Test
)
)
.settings(publishSettings)
lazy val spray = project
.in(file("spray"))
.dependsOn(core, testkit % Test)
.settings(
name := "kafka-serialization-spray",
libraryDependencies ++= Seq("io.spray" %% "spray-json" % sprayJsonVersion)
)
.settings(publishSettings)
lazy val core = project
.in(file("core"))
.dependsOn(testkit % Test)
.settings(
name := "kafka-serialization-core",
libraryDependencies ++= Seq(
"org.apache.kafka" % "kafka-clients" % kafkaClientVersion exclude ("org.slf4j", "slf4j-log4j12"),
"org.slf4j" % "slf4j-api" % slf4jVersion
)
)
.settings(publishSettings)
lazy val cats = project
.in(file("cats"))
.dependsOn(core, testkit % Test)
.settings(
name := "kafka-serialization-cats",
libraryDependencies ++= Seq("org.typelevel" %% "cats-core" % catsVersion)
)
.settings(publishSettings)