-
Notifications
You must be signed in to change notification settings - Fork 15
Expand file tree
/
Copy pathbuild.sbt
More file actions
342 lines (312 loc) · 13.3 KB
/
build.sbt
File metadata and controls
342 lines (312 loc) · 13.3 KB
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
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* license agreements; and to You under the Apache License, version 2.0:
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* This file is part of the Apache Pekko project, which was derived from Akka.
*/
import net.bzzt.reproduciblebuilds.ReproducibleBuildsPlugin.reproducibleBuildsCheckResolver
import org.apache.pekko.projections.Dependencies
ThisBuild / versionScheme := Some(VersionScheme.SemVerSpec)
sourceDistName := "apache-pekko-projection"
sourceDistIncubating := false
ThisBuild / evictionErrorLevel := Level.Info
ThisBuild / resolvers += Resolver.ApacheMavenSnapshotsRepo
ThisBuild / reproducibleBuildsCheckResolver := Resolver.ApacheMavenStagingRepo
ThisBuild / javafmtFormatterCompatibleJavaVersion := 17
lazy val core =
Project(id = "core", base = file("core"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.core)
.settings(AutomaticModuleName.settings("pekko.projection.core"))
.settings(name := "pekko-projection-core")
.settings(Protobuf.settings)
lazy val coreTest =
Project(id = "core-test", base = file("core-test"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.coreTest)
.settings(name := "pekko-projection-core-test")
.settings(publish / skip := true)
.dependsOn(core)
.dependsOn(testkit % Test)
lazy val testkit =
Project(id = "testkit", base = file("testkit"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.testKit)
.settings(AutomaticModuleName.settings("pekko.projection.testkit"))
.settings(name := "pekko-projection-testkit")
.dependsOn(core)
// provides offset storage backed by a JDBC table
lazy val jdbc =
Project(id = "jdbc", base = file("jdbc"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.jdbc)
.settings(AutomaticModuleName.settings("pekko.projection.jdbc"))
.settings(name := "pekko-projection-jdbc")
.dependsOn(core)
.dependsOn(coreTest % "test->test")
.dependsOn(testkit % Test)
lazy val jdbcIntTest =
Project(id = "jdbc-int-test", base = file("jdbc-int-test"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.jdbc)
.settings(
name := "pekko-projection-jdbc-int-test",
publish / skip := true,
Test / parallelExecution := false)
.dependsOn(jdbc % "test->test")
.dependsOn(coreTest % "test->test")
.dependsOn(testkit % Test)
// provides offset storage backed by a JDBC (Slick) table
lazy val slick =
Project(id = "slick", base = file("slick"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(
// Transitive dependency `scala-reflect` to avoid `NoClassDefFoundError`.
// See: https://github.com/slick/slick/issues/2933
libraryDependencies ++=
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, _)) => Seq("org.scala-lang" % "scala-reflect" % scalaVersion.value)
case _ => Nil
}))
.settings(Dependencies.slick)
.settings(AutomaticModuleName.settings("pekko.projection.slick"))
.settings(
name := "pekko-projection-slick",
versionScheme := None)
.dependsOn(jdbc)
.dependsOn(core)
.dependsOn(coreTest % "test->test")
.dependsOn(testkit % Test)
lazy val slickIntTest =
Project(id = "slick-int-test", base = file("slick-int-test"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.slick)
.settings(
name := "pekko-projection-slick-int-test",
versionScheme := None,
publish / skip := true,
Test / parallelExecution := false)
.dependsOn(slick % "test->test")
.dependsOn(core)
.dependsOn(coreTest % "test->test")
.dependsOn(testkit % Test)
// provides offset storage backed by a Cassandra table
lazy val cassandra =
Project(id = "cassandra", base = file("cassandra"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.cassandra)
.settings(AutomaticModuleName.settings("pekko.projection.cassandra"))
.settings(name := "pekko-projection-cassandra")
.dependsOn(core)
lazy val cassandraTest =
Project(id = "cassandra-test", base = file("cassandra-test"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.cassandra)
.settings(name := "pekko-projection-cassandra-test")
.settings(publish / skip := true)
.settings(Test / parallelExecution := false)
.dependsOn(core)
.dependsOn(cassandra)
.dependsOn(coreTest % "test->test")
.dependsOn(testkit % Test)
// provides source providers for pekko-persistence-query
lazy val eventsourced =
Project(id = "eventsourced", base = file("eventsourced"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.eventsourced)
.settings(AutomaticModuleName.settings("pekko.projection.eventsourced"))
.settings(name := "pekko-projection-eventsourced")
.dependsOn(core)
.dependsOn(testkit % Test)
// provides offset storage backed by Kafka managed offset commits
lazy val kafka =
Project(id = "kafka", base = file("kafka"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.kafka)
.settings(AutomaticModuleName.settings("pekko.projection.kafka"))
.settings(name := "pekko-projection-kafka")
.dependsOn(core)
.dependsOn(testkit % "test")
lazy val kafkaTest =
Project(id = "kafka-test", base = file("kafka-test"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.kafkaTest)
.settings(
name := "pekko-projection-kafka-test",
publish / skip := true)
.dependsOn(kafka % "test->test")
.dependsOn(slick % "compile;test->test")
.dependsOn(testkit % "test")
// provides source providers for durable state changes
lazy val `durable-state` =
Project(id = "durable-state", base = file("durable-state"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.state)
.settings(AutomaticModuleName.settings("pekko.projection.durable-state"))
.settings(name := "pekko-projection-durable-state")
.dependsOn(core)
.dependsOn(testkit % Test)
// provides event producer/consumer over gRPC
lazy val grpc =
Project(id = "grpc", base = file("grpc"))
.enablePlugins(ReproducibleBuildsPlugin, PekkoGrpcPlugin)
.disablePlugins(MimaPlugin) // new in 2.0.0
.settings(Dependencies.grpc)
.settings(AutomaticModuleName.settings("pekko.projection.grpc"))
.settings(
name := "pekko-projection-grpc",
pekkoGrpcCodeGeneratorSettings += "server_power_apis")
.dependsOn(core)
.dependsOn(eventsourced)
.dependsOn(testkit % Test)
// provides offset storage backed by a R2DBC table
lazy val r2dbc =
Project(id = "r2dbc", base = file("r2dbc"))
.enablePlugins(ReproducibleBuildsPlugin)
.settings(Dependencies.r2dbc)
.settings(AutomaticModuleName.settings("pekko.projection.r2dbc"))
.settings(
name := "pekko-projection-r2dbc")
.dependsOn(core)
lazy val grpcTest =
Project(id = "grpc-test", base = file("grpc-test"))
.enablePlugins(PekkoGrpcPlugin)
.disablePlugins(MimaPlugin)
.settings(Dependencies.grpcTest)
.settings(
name := "pekko-projection-grpc-test",
publish / skip := true,
// following is needed by Agrona lib
// https://github.com/aeron-io/agrona/wiki/Change-Log#200-2024-12-17
Test / fork := true,
Test / javaOptions += "--add-opens=java.base/jdk.internal.misc=ALL-UNNAMED")
.dependsOn(grpc % "compile;test->compile")
.dependsOn(testkit % Test)
lazy val grpcIntTest =
Project(id = "grpc-int-test", base = file("grpc-int-test"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.grpcIntTest)
.settings(
name := "pekko-projection-grpc-int-test",
publish / skip := true,
Test / parallelExecution := false,
// we need to access snapshot jars for pekko-persistence-r2dbc
resolvers += Resolver.ApacheMavenSnapshotsRepo)
.dependsOn(grpcTest % "test->test;test->compile")
.dependsOn(eventsourced % Test)
.dependsOn(r2dbc % Test)
.dependsOn(testkit % Test)
lazy val r2dbcIntTest =
Project(id = "r2dbc-int-test", base = file("r2dbc-int-test"))
.disablePlugins(MimaPlugin)
.settings(Dependencies.r2dbc)
.settings(
name := "pekko-projection-r2dbc-int-test",
publish / skip := true,
Test / parallelExecution := false,
// there are some compile warnings in the test code (Scala 2.13)
scalacOptions ++= Seq(
"-Wconf:msg=Implicit resolves to enclosing:s",
"-Wconf:msg=outer reference in this type test:s",
"-Wconf:cat=lint:s"))
.dependsOn(core)
.dependsOn(coreTest % "test->test")
.dependsOn(r2dbc % "test->test;test->compile")
.dependsOn(eventsourced % Test)
.dependsOn(`durable-state` % Test)
.dependsOn(testkit % Test)
lazy val userProjects: Seq[ProjectReference] = List[ProjectReference](
core, jdbc, slick, cassandra, eventsourced, kafka, `durable-state`, r2dbc, grpc, testkit)
lazy val examples = project
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(MimaPlugin)
.settings(Dependencies.examples)
.dependsOn(slick % "test->test")
.dependsOn(jdbc % "test->test")
.dependsOn(cassandraTest % "test->test")
.dependsOn(eventsourced)
.dependsOn(`durable-state`)
.dependsOn(kafka % "test->test")
.dependsOn(testkit % Test)
.settings(publish / skip := true, scalacOptions += "-feature", javacOptions += "-parameters")
lazy val integrationExamples = Project("integration-examples", file("integration-examples"))
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(MimaPlugin)
.settings(Dependencies.examples)
.dependsOn(slick % "test->test")
.dependsOn(jdbc % "test->test")
.dependsOn(cassandraTest % "test->test")
.dependsOn(eventsourced)
.dependsOn(`durable-state`)
.dependsOn(kafka % "test->test")
.dependsOn(examples % "test->test")
.dependsOn(testkit % Test)
.settings(publish / skip := true,
scalacOptions += "-feature",
javacOptions += "-parameters",
Test / parallelExecution := false)
lazy val docs = project
.enablePlugins(PekkoParadoxPlugin, ParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin)
.disablePlugins(MimaPlugin)
.dependsOn(core, testkit)
.settings(
name := "Apache Pekko Projections",
pekkoParadoxGithub := Some("https://github.com/apache/pekko-projection"),
publish / skip := true,
makeSite := makeSite.dependsOn(LocalRootProject / ScalaUnidoc / doc).value,
previewPath := (Paradox / siteSubdirName).value,
Preprocess / siteSubdirName := s"api/pekko-projection/${projectInfoVersion.value}",
Preprocess / sourceDirectory := (LocalRootProject / ScalaUnidoc / unidoc / target).value,
Paradox / siteSubdirName := s"docs/pekko-projection/${projectInfoVersion.value}",
Compile / paradoxProperties ++= Map(
"project.url" -> "https://pekko.apache.org/docs/pekko-projection/current/",
"canonical.base_url" -> "https://pekko.apache.org/docs/pekko-projection/current",
"github.base_url" -> "https://github.com/apache/pekko-projection",
"pekko.version" -> Dependencies.Versions.pekko,
// Pekko
"extref.pekko.base_url" -> s"https://pekko.apache.org/docs/pekko/${Dependencies.PekkoVersionInDocs}/%s",
"scaladoc.pekko.base_url" -> s"https://pekko.apache.org/api/pekko/${Dependencies.PekkoVersionInDocs}/",
"javadoc.pekko.base_url" -> s"https://pekko.apache.org/japi/pekko/${Dependencies.PekkoVersionInDocs}/",
"javadoc.pekko.link_style" -> "direct",
// Java
"javadoc.base_url" -> "https://docs.oracle.com/javase/8/docs/api/",
// Scala
"scaladoc.scala.base_url" -> s"https://www.scala-lang.org/api/${scalaBinaryVersion.value}.x/",
"scaladoc.pekko.projection.base_url" -> s"/${(Preprocess / siteSubdirName).value}/",
"javadoc.pekko.projection.base_url" -> ""),
paradoxGroups := Map("Language" -> Seq("Java", "Scala")),
paradoxRoots := List("index.html", "getting-started/event-generator-app.html"),
apidocRootPackage := "org.apache.pekko",
Global / pekkoParadoxIncubatorNotice := None,
Compile / paradoxMarkdownToHtml / sourceGenerators += Def.taskDyn {
val targetFile = (Compile / paradox / sourceManaged).value / "license-report.md"
(LocalRootProject / dumpLicenseReportAggregate).map { dir =>
IO.copy(List(dir / "pekko-projection-root-licenses.md" -> targetFile)).toList
}
}.taskValue)
lazy val billOfMaterials = Project("bill-of-materials", file("bill-of-materials"))
.enablePlugins(BillOfMaterialsPlugin)
.disablePlugins(MimaPlugin, SitePlugin)
.settings(
name := "pekko-projection-bom",
licenses := List(License.Apache2),
bomIncludeProjects := userProjects,
description := s"${description.value} (depending on Scala ${CrossVersion.binaryScalaVersion(scalaVersion.value)})")
lazy val root = Project(id = "projection", base = file("."))
.aggregate(userProjects: _*)
.aggregate(billOfMaterials, coreTest, kafkaTest, cassandraTest, grpcTest, examples, integrationExamples, docs)
.settings(
publish / skip := true,
name := "pekko-projection-root")
.enablePlugins(ScalaUnidocPlugin)
.disablePlugins(SitePlugin, MimaPlugin)
// check format and headers
TaskKey[Unit]("verifyCodeFmt") := {
javafmtCheckAll.all(ScopeFilter(inAnyProject)).result.value.toEither.left.foreach { _ =>
throw new MessageOnlyException(
"Unformatted Java code found. Please run 'javafmtAll' and commit the reformatted code")
}
}
addCommandAlias("verifyCodeStyle", "headerCheckAll; verifyCodeFmt")