This repository has been archived by the owner on Dec 6, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
185 lines (169 loc) · 5.35 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
import sbt.Keys._
import sbt.addCompilerPlugin
import scala.xml.transform.{RewriteRule, RuleTransformer}
val akkaVersion = "2.5.2"
val catsVersion = "0.9.0"
val monixVersion = "2.2.4"
val removeScoverage = new RuleTransformer(
new RewriteRule {
private[this] def isGroupScoverage(child: xml.Node): Boolean =
child.label == "groupId" && child.text == "org.scoverage"
override def transform(node: xml.Node): Seq[xml.Node] = node match {
case e: xml.Elem if e.label == "dependency" && e.child.exists(isGroupScoverage) => Nil
case _ => Seq(node)
}
}
)
val scalacOpts = List(
"-deprecation",
"-encoding",
"UTF-8",
"-feature",
"-language:existentials",
"-language:experimental.macros",
"-language:higherKinds",
"-language:implicitConversions",
"-unchecked",
"-Xfatal-warnings",
"-Xlint",
"-Yno-adapted-args",
"-Yrangepos",
"-Ywarn-dead-code",
"-Ywarn-numeric-widen",
"-Ywarn-unused-import",
"-Ypartial-unification"
)
lazy val doNotPublishArtifact = Seq(
publishArtifact := false,
publishArtifact in (Compile, packageDoc) := false,
publishArtifact in (Compile, packageSrc) := false,
publishArtifact in (Compile, packageBin) := false
)
val commonSettings = Seq(
version := "0.1.0",
organization := "net.vectos",
scalaVersion := "2.12.1",
scalacOptions ++= Seq(
"-language:higherKinds",
"-feature",
"-deprecation",
"-Yno-adapted-args",
"-Xlint",
"-Xfatal-warnings",
"-unchecked"
),
scalacOptions in compile ++= Seq(
"-Yno-imports",
"-Ywarn-numeric-widen"
),
pomPostProcess := { (node: xml.Node) =>
removeScoverage.transform(node).head
},
resolvers += Resolver.sonatypeRepo("releases"),
resolvers += "Confluent Repo" at "http://packages.confluent.io/maven",
addCompilerPlugin("org.spire-math" %% "kind-projector" % "0.9.4")
)
val codeQualitySettings = Seq(
wartremoverErrors in (Compile, compile) ++= Warts.allBut(
Wart.DefaultArguments,
Wart.StringPlusAny,
Wart.Recursion,
Wart.ArrayEquals,
Wart.ImplicitParameter,
Wart.Equals,
Wart.Any,
Wart.AsInstanceOf,
Wart.IsInstanceOf,
Wart.Nothing,
Wart.Throw,
Wart.NonUnitStatements
),
wartremoverErrors in (Test, compile) := Seq()
)
val codeProjectSettings = commonSettings ++ codeQualitySettings
lazy val core = project
.in(file("core"))
.settings(codeProjectSettings)
.settings(
name := "flumina-core",
libraryDependencies ++= Seq(
"org.typelevel" %% "cats-free" % catsVersion,
"org.scodec" %% "scodec-core" % "1.10.3",
"org.scodec" %% "scodec-bits" % "1.1.2",
"org.xerial.snappy" % "snappy-java" % "1.1.2.6"
)
)
lazy val akka = project
.in(file("akka"))
.settings(codeProjectSettings)
.settings(
name := "flumina-akka",
libraryDependencies ++= Seq(
"com.github.melrief" %% "pureconfig" % "0.6.0",
"com.typesafe.akka" %% "akka-actor" % akkaVersion
)
)
.dependsOn(core)
lazy val avro4s = project
.in(file("avro4s"))
.settings(codeProjectSettings)
.settings(
name := "flumina-avro4s",
libraryDependencies ++= Seq(
"io.confluent" % "kafka-schema-registry-client" % "3.2.1",
"com.sksamuel.avro4s" %% "avro4s-core" % "1.6.4"
)
)
.dependsOn(core)
lazy val monix = project
.in(file("monix"))
.settings(codeProjectSettings)
.settings(
name := "flumina-monix",
parallelExecution in Test := false,
libraryDependencies ++= Seq(
"io.monix" %% "monix" % monixVersion,
"io.monix" %% "monix-cats" % monixVersion
)
)
.dependsOn(akka)
lazy val docs = project
.in(file("docs"))
.settings(doNotPublishArtifact)
.settings(commonSettings)
.dependsOn(core, akka, monix, avro4s)
.enablePlugins(MicrositesPlugin)
.settings(name := "flumina-docs")
.settings(
micrositeName := "Flumina",
micrositeDescription := "Scala Kafka client",
micrositeAuthor := "Mark de Jong",
micrositeGithubOwner := "vectos",
micrositeGithubRepo := "flumina",
micrositeBaseUrl := "/flumina",
micrositeDocumentationUrl := "/flumina/docs/",
micrositeHighlightTheme := "color-brewer"
)
lazy val tests = project
.in(file("tests"))
.settings(commonSettings)
.settings(doNotPublishArtifact)
.settings(
name := "flumina-tests",
parallelExecution in Test := false,
coverageMinimum := 80,
coverageFailOnMinimum := false,
wartremoverErrors in (Test, compile) := Seq(),
libraryDependencies ++= Seq(
"com.github.alexarchambault" %% "scalacheck-shapeless_1.13" % "1.1.5" % Test,
"org.typelevel" %% "cats-laws" % catsVersion % Test,
"org.typelevel" %% "cats-kernel-laws" % catsVersion % Test,
"com.ironcorelabs" %% "cats-scalatest" % "2.2.0" % Test,
"com.typesafe.akka" %% "akka-testkit" % akkaVersion % Test,
"com.spotify" % "docker-client" % "3.5.13" % Test,
"com.fasterxml.jackson.jaxrs" % "jackson-jaxrs-json-provider" % "2.6.7" % Test,
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.7" % Test
)
)
.dependsOn(monix, avro4s)
addCommandAlias("validate", "; clean; scalafmt; tests/test; docs/makeMicrosite")