-
Notifications
You must be signed in to change notification settings - Fork 2
/
build.sbt
230 lines (208 loc) · 6.53 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
import sbtcrossproject.CrossProject
import com.typesafe.tools.mima.core._
import laika.config.PrettyURLs
import laika.config.LinkConfig
import laika.config.ApiLinks
import laika.config.SourceLinks
ThisBuild / tlBaseVersion := "0.5"
ThisBuild / organization := "com.commercetools"
ThisBuild / organizationName := "Commercetools GmbH"
ThisBuild / startYear := Some(2024)
ThisBuild / licenses := Seq(License.Apache2)
ThisBuild / tlCiDependencyGraphJob := false
val Scala213 = "2.13.15"
ThisBuild / crossScalaVersions := Seq(Scala213, "3.3.4")
ThisBuild / scalaVersion := Scala213
ThisBuild / sonatypeCredentialHost := xerial.sbt.Sonatype.sonatypeLegacy
lazy val root =
tlCrossRootProject.aggregate(
core,
testing,
azureServiceBus,
awsSQS,
awsSqsIt,
gcpPubSub,
gcpPubSubIt,
circe,
otel4s,
unidocs)
ThisBuild / tlSitePublishBranch := Some("main")
val commonSettings = List(
libraryDependencies ++= Seq(
"org.scalameta" %%% "munit" % Versions.munit % Test,
"org.typelevel" %%% "munit-cats-effect" % Versions.munitCatsEffect % Test,
"org.typelevel" %%% "cats-effect-testkit" % "3.5.4" % Test
),
scalacOptions += (scalaVersion.value match {
case Scala213 => "-Wunused"
case _ => "-Wunused:all"
})
)
lazy val core: CrossProject = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("core"))
.settings(commonSettings)
.settings(
name := "fs2-queues-core",
libraryDependencies ++= List(
"co.fs2" %%% "fs2-core" % Versions.fs2
)
)
lazy val testing = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("testing"))
.settings(commonSettings)
.settings(
name := "fs2-queues-testing",
libraryDependencies ++= List(
"org.typelevel" %%% "cats-collections-core" % "0.9.9"
)
)
.dependsOn(core)
lazy val testkit = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("testkit"))
.enablePlugins(NoPublishPlugin)
.settings(commonSettings)
.settings(
name := "fs2-queues-testkit",
libraryDependencies ++= List(
"org.scalameta" %%% "munit" % Versions.munit,
"org.typelevel" %%% "munit-cats-effect" % Versions.munitCatsEffect,
"org.slf4j" % "slf4j-simple" % "2.0.16"
)
)
.dependsOn(core)
// for sqs integration test, start a localstack with sqs
ThisBuild / githubWorkflowBuildPreamble := List(
WorkflowStep.Use(
UseRef.Public(owner = "actions", repo = "setup-python", ref = "v5"),
name = Some("Install Python 3.10"),
params = Map("python-version" -> "3.10.15")),
WorkflowStep.Use(
UseRef.Public(owner = "LocalStack", repo = "setup-localstack", ref = "v0.2.3"),
name = Some("Install localstack"),
params = Map("image-tag" -> "latest"),
env = Map("SERVICES" -> "sqs")
),
WorkflowStep.Use(
UseRef.Public(owner = "google-github-actions", repo = "setup-gcloud", ref = "v2"),
name = Some("Install gcloud"),
params = Map("install_components" -> "beta,pubsub-emulator")
),
WorkflowStep.Run(commands = List("./gcp/pubsub/emulator/start.sh &"), name = Some("Run PubSub emulator"))
)
lazy val otel4s = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("otel4s"))
.settings(commonSettings)
.settings(
name := "fs2-queues-otel4s",
description := "Support for metrics and tracing using otel4s",
libraryDependencies ++= List(
"org.typelevel" %%% "otel4s-core" % "0.10.0"
)
)
.dependsOn(core, testing % Test)
lazy val circe = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("circe"))
.settings(commonSettings)
.settings(
name := "fs2-queues-circe",
libraryDependencies ++= List(
"io.circe" %%% "circe-parser" % Versions.circe
)
)
.dependsOn(core)
lazy val azureServiceBus = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("azure/service-bus"))
.settings(commonSettings)
.settings(
name := "fs2-queues-azure-service-bus",
libraryDependencies ++= List(
"com.azure" % "azure-messaging-servicebus" % "7.17.4"
)
)
.dependsOn(core, testkit % Test)
lazy val azureServiceBusIt = project
.in(file("azure/service-bus/integration"))
.enablePlugins(NoPublishPlugin)
.settings(commonSettings)
.settings(
libraryDependencies ++= List(
"com.azure" % "azure-identity" % "1.11.1"
)
)
.dependsOn(azureServiceBus.jvm % Test, testkit.jvm % Test)
lazy val awsSQS = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("aws/sqs"))
.settings(commonSettings)
.settings(
name := "fs2-queues-aws-sqs",
libraryDependencies ++= List(
"software.amazon.awssdk" % "sqs" % "2.28.16"
)
)
.dependsOn(core)
lazy val awsSqsIt = project
.in(file("aws/sqs/integration"))
.enablePlugins(NoPublishPlugin)
.settings(commonSettings)
.dependsOn(awsSQS.jvm % Test, testkit.jvm % Test)
lazy val gcpPubSub = crossProject(JVMPlatform)
.crossType(CrossType.Pure)
.in(file("gcp/pubsub"))
.settings(commonSettings)
.settings(
name := "fs2-queues-gcp-pubsub",
libraryDependencies ++= List(
"com.google.cloud" % "google-cloud-pubsub" % "1.133.1",
"com.google.cloud" % "google-cloud-monitoring" % "3.52.0"
)
)
.dependsOn(core)
lazy val gcpPubSubIt = project
.in(file("gcp/pubsub/integration"))
.enablePlugins(NoPublishPlugin)
.settings(commonSettings)
.dependsOn(gcpPubSub.jvm % Test, testkit.jvm % Test)
lazy val docs = project
.in(file("site"))
.enablePlugins(TypelevelSitePlugin)
.settings(
tlSiteApiPackage := Some("com.commercetools.queue"),
tlSiteHelium := CTTheme(tlSiteHelium.value),
laikaConfig := tlSiteApiUrl.value
.fold(laikaConfig.value) { apiUrl =>
laikaConfig.value.withConfigValue(
LinkConfig.empty
.addApiLinks(ApiLinks(baseUri = apiUrl.toString().dropRight("index.html".size)))
.addSourceLinks(
SourceLinks(baseUri = "https://github.com/commercetools/fs2-queues", suffix = "scala")
))
},
laikaExtensions += PrettyURLs,
tlFatalWarnings := false,
libraryDependencies ++= List(
"com.azure" % "azure-identity" % "1.11.1",
"org.typelevel" %% "cats-effect-testkit" % "3.5.4"
)
)
.dependsOn(circe.jvm, azureServiceBus.jvm, awsSQS.jvm, gcpPubSub.jvm, otel4s.jvm, testing.jvm)
lazy val unidocs = project
.in(file("unidocs"))
.enablePlugins(TypelevelUnidocPlugin)
.settings(
name := "fs2-queues-docs",
ScalaUnidoc / unidoc / unidocProjectFilter := inProjects(
core.jvm,
circe.jvm,
azureServiceBus.jvm,
awsSQS.jvm,
gcpPubSub.jvm,
otel4s.jvm,
testing.jvm)
)