forked from ocadotechnology/pass4s
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.sbt
239 lines (210 loc) · 7.71 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
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
ThisBuild / tlBaseVersion := "0.4" // current series x.y
ThisBuild / organization := "com.ocadotechnology"
ThisBuild / organizationName := "Ocado Technology"
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / developers := List(
tlGitHubDev("majk-p", "Michał Pawlik"),
tlGitHubDev("matwojcik", "Mateusz Wójcik")
)
ThisBuild / versionScheme := Some("early-semver")
ThisBuild / homepage := Some(url("https://github.com/ocadotechnology/sttp-oauth2"))
val Scala213 = "2.13.11"
ThisBuild / scalaVersion := Scala213
ThisBuild / githubWorkflowJavaVersions := Seq(JavaSpec.graalvm("11"))
ThisBuild / githubWorkflowBuild ++= Seq(
WorkflowStep.Sbt(
commands = List("IntegrationTest/test"),
name = Some("Integration tests")
)
)
val Versions = new {
val ActiveMq = "5.17.4"
val CatsEffect = "3.4.11"
val Circe = "0.14.5"
val Fs2 = "3.6.1"
val Logback = "1.4.8"
val Log4Cats = "2.5.0"
val Weaver = "0.8.3"
val Laserdisc = "6.0.0"
}
lazy val IntegrationTest = config("it") extend Test
lazy val root = (project in file("."))
.configs(IntegrationTest)
.enablePlugins(NoPublishPlugin)
.settings(
commonSettings,
name := "pass4s",
libraryDependencies ++= Seq(
"com.amazonaws" % "amazon-sqs-java-extended-client-lib" % "2.0.3",
"com.disneystreaming" %% "weaver-cats" % Versions.Weaver,
"com.disneystreaming" %% "weaver-framework" % Versions.Weaver,
"com.disneystreaming" %% "weaver-scalacheck" % Versions.Weaver,
"org.scalatest" %% "scalatest" % "3.2.16", // just for `shouldNot compile`
"com.dimafeng" %% "testcontainers-scala-localstack-v2" % "0.40.17",
"com.amazonaws" % "aws-java-sdk-core" % "1.12.495" exclude ("*", "*"), // fixme after release of https://github.com/testcontainers/testcontainers-java/pull/5827
"com.dimafeng" %% "testcontainers-scala-mockserver" % "0.40.17",
"org.mock-server" % "mockserver-client-java" % "5.15.0",
"org.apache.activemq" % "activemq-broker" % Versions.ActiveMq,
"org.typelevel" %% "log4cats-core" % Versions.Log4Cats,
"org.typelevel" %% "log4cats-slf4j" % Versions.Log4Cats,
"ch.qos.logback" % "logback-classic" % Versions.Logback
).map(_ % IntegrationTest),
Defaults.itSettings,
inConfig(IntegrationTest) {
Defaults.testSettings
},
IntegrationTest / classDirectory := (Test / classDirectory).value,
IntegrationTest / parallelExecution := true
)
.aggregate(core, kernel, high, activemq, kinesis, sns, sqs, circe, phobos, plaintext, extra, logging, demo, s3Proxy)
.dependsOn(high, activemq, kinesis, sns, sqs, circe, logging, extra, s3Proxy)
def module(name: String, directory: String = ".") = Project(s"pass4s-$name", file(directory) / name).settings(commonSettings)
lazy val core = module("core")
.settings(
libraryDependencies ++= Seq(
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
"co.fs2" %% "fs2-core" % Versions.Fs2,
"org.typelevel" %% "cats-effect" % Versions.CatsEffect
)
)
lazy val kernel = module("kernel").settings(
libraryDependencies ++= Seq(
"co.fs2" %% "fs2-core" % Versions.Fs2,
"org.typelevel" %% "cats-effect" % Versions.CatsEffect,
"org.typelevel" %% "cats-tagless-core" % "0.14.0",
"org.typelevel" %% "cats-laws" % "2.9.0" % Test,
"com.disneystreaming" %% "weaver-discipline" % Versions.Weaver % Test
)
)
lazy val high = module("high")
.dependsOn(core, kernel)
// connectors
val awsSnykOverrides = Seq(
"commons-codec" % "commons-codec" % "1.15"
)
lazy val activemq = module("activemq", directory = "connectors")
.settings(
name := "pass4s-connector-activemq",
libraryDependencies ++= Seq(
"com.lightbend.akka" %% "akka-stream-alpakka-jms" % "4.0.0", // 5.x.x contains akka-streams +2.7.x which is licensed under BUSL 1.1
"org.apache.activemq" % "activemq-pool" % Versions.ActiveMq,
"org.typelevel" %% "log4cats-core" % Versions.Log4Cats
),
headerSources / excludeFilter := HiddenFileFilter || "taps.scala"
)
.dependsOn(core)
lazy val kinesis = module("kinesis", directory = "connectors")
.settings(
name := "pass4s-connector-kinesis",
libraryDependencies ++= Seq(
"io.laserdisc" %% "pure-kinesis-tagless" % Versions.Laserdisc
) ++ awsSnykOverrides
)
.dependsOn(core)
lazy val sns = module("sns", directory = "connectors")
.settings(
name := "pass4s-connector-sns",
libraryDependencies ++= Seq(
"io.laserdisc" %% "pure-sns-tagless" % Versions.Laserdisc
) ++ awsSnykOverrides
)
.dependsOn(core)
lazy val sqs = module("sqs", directory = "connectors")
.settings(
name := "pass4s-connector-sqs",
libraryDependencies ++= Seq(
"io.laserdisc" %% "pure-sqs-tagless" % Versions.Laserdisc,
"org.typelevel" %% "log4cats-core" % Versions.Log4Cats
) ++ awsSnykOverrides
)
.dependsOn(core)
// addons
lazy val circe = module("circe", directory = "addons")
.settings(
libraryDependencies ++= Seq(
"io.circe" %% "circe-parser" % Versions.Circe
)
)
.dependsOn(core, kernel)
lazy val phobos = module("phobos", directory = "addons")
.settings(
libraryDependencies ++= Seq(
"ru.tinkoff" %% "phobos-core" % "0.20.0"
)
)
.dependsOn(core, kernel)
lazy val plaintext = module("plaintext", directory = "addons")
.dependsOn(core, kernel)
lazy val extra = module("extra", directory = "addons")
.dependsOn(high, circe)
lazy val s3Proxy = module("s3proxy", directory = "addons")
.settings(
libraryDependencies ++= Seq(
"io.laserdisc" %% "pure-s3-tagless" % Versions.Laserdisc,
"io.circe" %% "circe-literal" % Versions.Circe % Test
) ++ awsSnykOverrides
)
.dependsOn(high, circe)
lazy val logging = module("logging", directory = "addons")
.settings(
libraryDependencies ++= Seq(
"org.typelevel" %% "log4cats-core" % Versions.Log4Cats
)
)
.dependsOn(high)
def latestStableVersion = {
import scala.sys.process._
"git -c versionsort.suffix=- tag --list --sort=-version:refname"
.!!
.split("\n")
.toList
.map(_.trim)
.filter(_.startsWith("v"))
.head
}
// online documentation
lazy val docs = project // new documentation project
.in(file("mdoc")) // important: it must not be docs/
.settings(
mdocVariables := Map(
"VERSION" -> { if (isSnapshot.value) latestStableVersion else version.value }
),
githubWorkflowBuild := Seq(
WorkflowStep.Sbt(List("docs/mdoc"))
)
)
.dependsOn(high, activemq, kinesis, sns, sqs, circe, logging, extra, s3Proxy)
.enablePlugins(MdocPlugin, DocusaurusPlugin)
// misc
lazy val demo = module("demo")
.enablePlugins(NoPublishPlugin)
.settings(
publishArtifact := false,
// mimaPreviousArtifacts := Set(), // TODO
libraryDependencies ++= Seq(
"io.circe" %% "circe-generic" % Versions.Circe,
"org.typelevel" %% "log4cats-core" % Versions.Log4Cats,
"org.typelevel" %% "log4cats-slf4j" % Versions.Log4Cats,
"ch.qos.logback" % "logback-classic" % Versions.Logback
)
)
.dependsOn(activemq, sns, sqs, extra, logging)
lazy val commonSettings = Seq(
organization := "com.ocadotechnology",
compilerOptions,
Test / fork := true,
libraryDependencies ++= compilerPlugins,
// mimaPreviousArtifacts := Seq(), // TODO
libraryDependencies ++= Seq(
"com.disneystreaming" %% "weaver-cats" % Versions.Weaver,
"com.disneystreaming" %% "weaver-framework" % Versions.Weaver,
"com.disneystreaming" %% "weaver-scalacheck" % Versions.Weaver
).map(_ % Test),
testFrameworks += new TestFramework("weaver.framework.CatsEffect")
)
val compilerOptions =
scalacOptions -= "-Xfatal-warnings"
val compilerPlugins = Seq(
compilerPlugin("org.typelevel" %% "kind-projector" % "0.13.2" cross CrossVersion.full),
compilerPlugin("com.olegpy" %% "better-monadic-for" % "0.3.1")
)