forked from evolution-gaming/skafka
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
113 lines (103 loc) · 3.73 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
import Dependencies._
import com.typesafe.tools.mima.core._
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / evictionErrorLevel := Level.Warn
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 commonSettings = Seq(
organization := "com.evolutiongaming",
homepage := Some(new URL("https://github.com/evolution-gaming/skafka")),
startYear := Some(2018),
organizationName := "Evolution",
organizationHomepage := Some(url("https://evolution.com")),
scalaVersion := crossScalaVersions.value.head,
crossScalaVersions := Seq("2.13.12", "3.3.1", "2.12.18"),
licenses := Seq(("MIT", url("https://opensource.org/licenses/MIT"))),
releaseCrossBuild := true,
Compile / doc / scalacOptions += "-no-link-warnings",
scalacOptions ++= crossSettings(
scalaVersion.value,
if3 = List("-Ykind-projector", "-language:implicitConversions", "-explain", "-deprecation"),
if2 = List("-Xsource:3"),
),
libraryDependencies ++= crossSettings(
scalaVersion.value,
if3 = Nil,
if2 = List(compilerPlugin(`kind-projector` cross CrossVersion.full))
),
scalacOptsFailOnWarn := Some(false),
publishTo := Some(Resolver.evolutionReleases),
// KeyRanks.Invisible to suppress sbt warning about key not being used in root/tests where MiMa plugin is disabled
mimaPreviousArtifacts.withRank(KeyRanks.Invisible) := {
val versions = List(
"11.0.0",
)
// check against all versions once Scala 3 lib version is published
crossSettings(
scalaVersion.value,
if3 = Nil,
if2 = versions.map(organization.value %% moduleName.value % _)
).toSet
},
mimaBinaryIssueFilters ++= Seq(
ProblemFilters.exclude[ReversedMissingMethodProblem]("com.evolutiongaming.skafka.consumer.Consumer.subscribe"),
ProblemFilters.exclude[DirectMissingMethodProblem](
"com.evolutiongaming.skafka.Converters#MapJOps.asScalaMap$extension"
)
)
)
lazy val root = (project in file(".")
disablePlugins (MimaPlugin)
settings (name := "skafka")
settings commonSettings
settings (publish / skip := true)
aggregate (skafka, `play-json`, metrics, tests))
lazy val skafka = (project in file("skafka")
disablePlugins (MimaPlugin)
settings commonSettings
settings (name := "skafka",
scalacOptions -= "-Ywarn-unused:params",
libraryDependencies ++= Seq(
Cats.core,
CatsEffect.effect,
CatsEffect.effectStd,
`config-tools`,
Kafka.clients,
`future-helper`,
`cats-helper`,
Smetrics.smetrics,
scalatest % Test,
Cats.laws % Test,
discipline % Test,
`scala-java8-compat`,
`collection-compat`
)))
lazy val `play-json` = (project in file("modules/play-json")
settings (name := "skafka-play-json")
settings commonSettings
dependsOn skafka
settings (libraryDependencies ++= Seq(Dependencies.`play-json-jsoniter`, scalatest % Test)))
lazy val metrics = (project in file("modules/metrics")
settings (name := "skafka-metrics")
disablePlugins (MimaPlugin)
settings commonSettings
dependsOn skafka
settings (libraryDependencies ++= Seq(Smetrics.`smetrics-prometheus`)))
lazy val tests = (project in file("tests")
disablePlugins (MimaPlugin)
settings (name := "skafka-tests")
settings commonSettings
settings Seq(publish / skip := true, Test / fork := true, Test / parallelExecution := false)
dependsOn skafka % "compile->compile;test->test"
settings (libraryDependencies ++= Seq(
`testcontainers-kafka` % Test,
Slf4j.api % Test,
Slf4j.`log4j-over-slf4j` % Test,
Logback.core % Test,
Logback.classic % Test,
scalatest % Test
)))