-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.sbt
204 lines (189 loc) · 7.57 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
import ReleaseTransformations._
import com.here.bom.Bom
val currentScalaVersion = "2.13.15"
val scalaVersions = Seq("2.12.17", currentScalaVersion)
val awsVersion = "2.28.17"
val pekkoVersion = "1.1.1"
val catsCore = "org.typelevel" %% "cats-core" % "2.12.0"
lazy val aws2Bom = Bom("software.amazon.awssdk" % "bom" % awsVersion)
lazy val pekkoBom = Bom("org.apache.pekko" %% "pekko-bom" % pekkoVersion)
val checkEvictionsTask = taskKey[Unit]("Task that fails build if there are evictions")
lazy val depOverrides = Seq(
"org.slf4j" % "slf4j-api" % "2.0.16",
"commons-codec" % "commons-codec" % "1.17.1",
"com.typesafe" % "config" % "1.4.3",
"org.apache.httpcomponents" % "httpcore" % "4.4.16",
catsCore
)
lazy val commonSettings = Seq(
addCompilerPlugin("org.typelevel" % "kind-projector" % "0.13.3" cross CrossVersion.full),
scalaVersion := currentScalaVersion,
crossScalaVersions := scalaVersions,
aws2Bom,
pekkoBom,
scalacOptions ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, minor)) if minor >= 13 => Seq("-Ymacro-annotations", "-language:higherKinds")
case _ => Seq("-language:higherKinds")
}),
libraryDependencies ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, minor)) if minor >= 13 => Nil
case _ => Seq(
compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full),
"org.scala-lang.modules" % "scala-java8-compat_2.12" % "1.0.2")
}),
dependencyOverrides ++= (CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, minor)) if minor >= 13 => Seq(
"org.scala-lang.modules" %% "scala-collection-compat" % "2.2.0")
case _ => Nil
}),
libraryDependencies ++= Seq(
"org.slf4j" % "slf4j-api" % "2.0.16",
"org.slf4j" % "jcl-over-slf4j" % "2.0.16" % Test,
"ch.qos.logback" % "logback-classic" % "1.5.8" % Test,
"com.vladsch.flexmark" % "flexmark-all" % "0.64.8" % Test,
"org.scalatest" %% "scalatest" % "3.2.19" % Test),
dependencyOverrides ++= aws2Bom.key.value.bomDependencies,
dependencyOverrides ++= pekkoBom.key.value.bomDependencies,
dependencyOverrides ++= depOverrides,
dependencyOverrides ++= Seq(
"org.scala-lang" % "scala-compiler" % scalaVersion.value,
"org.scala-lang" % "scala-library" % scalaVersion.value,
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
),
Compile / console / scalacOptions ~=
(_ filterNot Set("-Xfatal-warnings", "-Xlint", "-Ywarn-unused-import")),
checkEvictionsTask := {
if (evicted.value.reportedEvictions.nonEmpty) {
throw new IllegalStateException(
"There are some incompatible classpath evictions warnings." +
" You can suppress them with dependencyOverrides setting.")
}
})
val sharedScalacOptions = Seq(
"-deprecation",
"-feature",
"-unchecked")
val releaseSettings = Seq(
organization := "com.nike.fleam",
organizationName := "Nike",
organizationHomepage := Some(url("http://engineering.nike.com")),
releaseCrossBuild := true,
publishTo := sonatypePublishToBundle.value,
sonatypeProfileName := "com.nike",
scalacOptions ++= sharedScalacOptions ++ Seq("-Xfatal-warnings", "-Xlint", "-Xlint:-adapted-args"),
Compile / console / scalacOptions ++= sharedScalacOptions,
Compile / doc / scalacOptions ++= sharedScalacOptions,
licenses += ("MIT", url("http://opensource.org/licenses/MIT")),
homepage := Some(url("https://github.com/Nike-Inc/Fleam")),
startYear := Some(2020),
scmInfo := Some(ScmInfo(
url("https://github.com/Nike-Inc/Fleam"),
"scm:[email protected]:Nike-Inc/Fleam.git"
)),
developers := List(
Developer(
id = "vendamere",
name = "Peter Vendamere",
email = "[email protected]",
url = url("https://github.com/vendamere")
)
))
releaseProcess := Seq[ReleaseStep](
checkSnapshotDependencies,
inquireVersions,
runClean,
runTest,
setReleaseVersion,
commitReleaseVersion,
tagRelease,
releaseStepCommandAndRemaining("+publishSigned"),
releaseStepCommand("sonatypeBundleRelease"),
setNextVersion,
commitNextVersion,
pushChanges
)
val coverageSettings = Seq(
coverageMinimumStmtTotal := 60,
coverageFailOnMinimum := true,
Test / testOptions += Tests.Argument(TestFrameworks.ScalaTest, "-oDF"),
Test / testOptions +=
Tests.Argument(TestFrameworks.ScalaTest, "-h", "target/test-reports-html"))
lazy val core = (project in file("./core"))
.enablePlugins(spray.boilerplate.BoilerplatePlugin)
.settings(Revolver.settings: _*)
.settings(commonSettings)
.settings(releaseSettings)
.settings(coverageSettings)
.settings(
name := "fleam",
description := "Disjunctive and monadic stream processing with cats and pekko-streams",
libraryDependencies ++= Seq(
"org.apache.pekko" %% "pekko-stream" % pekkoVersion,
"org.apache.pekko" %% "pekko-actor" % pekkoVersion,
"org.apache.pekko" %% "pekko-slf4j" % pekkoVersion,
catsCore,
"org.typelevel" %% "simulacrum" % "1.0.1",
"org.typelevel" %% "discipline-core" % "1.7.0" % Test
),
coverageExcludedPackages := "")
lazy val sqs = (project in file("./aws/sqs"))
.dependsOn(core)
.dependsOn(core % "test->test")
.settings(Revolver.settings: _*)
.settings(commonSettings)
.settings(releaseSettings)
.settings(coverageSettings)
.settings(
name := "fleam-aws-sqs",
description := "Fleam SQS is a library of classes to aid in processing AWS SQS messages in a functional manner",
libraryDependencies += "software.amazon.awssdk" % "sqs" % awsVersion exclude("commons-logging", "commons-logging"),
libraryDependencies += "com.nike.fawcett" %% s"fawcett-sqs-v2" % "0.4.0")
lazy val cloudwatch = (project in file("./aws/cloudwatch"))
.dependsOn(core)
.dependsOn(core % "test->test")
.settings(Revolver.settings: _*)
.settings(commonSettings)
.settings(releaseSettings)
.settings(coverageSettings)
.settings(
name := "fleam-aws-cloudwatch",
description := "Provides a class to create a flow which logs a count to Cloudwatch as part of the stream",
libraryDependencies += "software.amazon.awssdk" % "cloudwatch" % awsVersion exclude("commons-logging", "commons-logging"))
lazy val docs = (project in file("./mdoc"))
.dependsOn(core, sqs, cloudwatch)
.enablePlugins(MdocPlugin)
.settings(commonSettings)
.settings(
mdocIn := file("./mdoc"),
mdocOut := file("./docs"))
.settings(
libraryDependencies ++= Seq(
"org.json4s" %% "json4s-jackson" % "4.0.7",
"com.iheart" %% "ficus" % "1.5.2"
),
publish := (()),
publishLocal := (()),
publishArtifact := false,
publish / skip := true,
dependencyOverrides ++= Seq(
"com.fasterxml.jackson.core" % "jackson-core" % "2.6.7",
"com.fasterxml.jackson.core" % "jackson-databind" % "2.6.7.3",
"com.typesafe" % "config" % "1.4.2",
"net.java.dev.jna" % "jna" % "5.14.0",
"org.jboss.logging" % "jboss-logging" % "3.4.0.Final",
"org.jboss.threads" % "jboss-threads" % "3.1.0.Final",
"org.jboss.xnio" % "xnio-api" % "3.7.7.Final",
"org.jboss.xnio" % "xnio-nio" % "3.7.7.Final",
"org.jsoup" % "jsoup" % "1.10.2",
"org.slf4j" % "slf4j-api" % "1.8.0-beta4",
"org.wildfly.common" % "wildfly-common" % "1.5.2.Final",
"com.lihaoyi" %% "fansi" % "0.5.0"
))
lazy val fleam = (project in file("."))
.aggregate(core, sqs, cloudwatch, docs)
.settings(releaseSettings)
.settings(addCommandAlias("check", "; +clean; checkEvictionsTask; +scalastyle; coverage; +test; coverageReport; docs/mdoc"): _*)
.settings(
publishArtifact := false,
scalaVersion := currentScalaVersion,
crossScalaVersions := scalaVersions)