forked from zio/zio-kafka
-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.sbt
97 lines (90 loc) · 3.58 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
import sbt.Keys.{ fork, parallelExecution }
lazy val scala212 = "2.12.15"
lazy val scala213 = "2.13.8"
lazy val scala3 = "3.1.1"
lazy val mainScala = scala213
lazy val allScala = Seq(scala212, scala3, mainScala)
lazy val zioVersion = "1.0.13"
lazy val kafkaVersion = "3.1.0"
lazy val embeddedKafkaVersion = "3.1.0" // Should be the same as kafkaVersion, except for the patch part
lazy val embeddedKafka = "io.github.embeddedkafka" %% "embedded-kafka" % embeddedKafkaVersion % Test
inThisBuild(
List(
organization := "dev.zio",
homepage := Some(url("https://github.com/zio/zio-kafka")),
licenses := List("Apache-2.0" -> url("http://www.apache.org/licenses/LICENSE-2.0")),
useCoursier := false,
scalaVersion := mainScala,
crossScalaVersions := allScala,
Test / parallelExecution := false,
Test / fork := true,
run / fork := true,
pgpPublicRing := file("/tmp/public.asc"),
pgpSecretRing := file("/tmp/secret.asc"),
pgpPassphrase := sys.env.get("PGP_PASSWORD").map(_.toArray),
scmInfo := Some(
ScmInfo(url("https://github.com/zio/zio-kafka/"), "scm:git:[email protected]:zio/zio-kafka.git")
),
developers := List(
Developer(
"iravid",
"Itamar Ravid",
url("https://github.com/iravid")
)
)
)
)
lazy val kafka =
project
.in(file("."))
.enablePlugins(BuildInfoPlugin)
.settings(
name := "zio-kafka",
scalafmtOnCompile := true,
Compile / compile / scalacOptions ++= {
if (scalaBinaryVersion.value == "2.13") Seq("-Wconf:cat=unused-nowarn:s")
else Seq()
},
// workaround for bad constant pool issue
(Compile / doc) := Def.taskDyn {
val default = (Compile / doc).taskValue
Def.task(default.value)
}.value
)
.settings(
buildInfoKeys := Seq[BuildInfoKey](organization, name, version, scalaVersion, sbtVersion, isSnapshot),
buildInfoPackage := "zio.kafka"
)
.settings(
resolvers += "Sonatype OSS Snapshots" at "https://oss.sonatype.org/content/repositories/snapshots",
libraryDependencies ++= Seq(
"dev.zio" %% "zio-streams" % zioVersion,
"dev.zio" %% "zio-test" % zioVersion % Test,
"dev.zio" %% "zio-test-sbt" % zioVersion % Test,
"org.apache.kafka" % "kafka-clients" % kafkaVersion,
"com.fasterxml.jackson.core" % "jackson-databind" % "2.12.6",
"ch.qos.logback" % "logback-classic" % "1.2.10" % Test,
"org.scala-lang.modules" %% "scala-collection-compat" % "2.6.0"
) ++ {
if (scalaBinaryVersion.value == "3")
Seq(
embeddedKafka
.cross(CrossVersion.for3Use2_13) exclude ("org.scala-lang.modules", "scala-collection-compat_2.13")
)
else Seq(embeddedKafka)
},
testFrameworks := Seq(new TestFramework("zio.test.sbt.ZTestFramework"))
)
lazy val docs = project
.in(file("zio-kafka-docs"))
.dependsOn(kafka)
.settings(
// Version will only appear on the generated target file replacing @VERSION@
mdocVariables := Map(
"VERSION" -> version.value
)
)
.enablePlugins(MdocPlugin)
addCommandAlias("fmt", "all scalafmtSbt scalafmt test:scalafmt")
addCommandAlias("check", "all scalafmtSbtCheck scalafmtCheck test:scalafmtCheck")