-
Notifications
You must be signed in to change notification settings - Fork 594
/
build.sbt
556 lines (516 loc) · 22.5 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
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
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
import akka._
import AkkaDependency._
import Dependencies.{h2specExe, h2specName}
import com.typesafe.sbt.MultiJvmPlugin.autoImport.MultiJvm
import java.nio.file.Files
import java.nio.file.attribute.{PosixFileAttributeView, PosixFilePermission}
import sbtdynver.GitDescribeOutput
import spray.boilerplate.BoilerplatePlugin
import com.lightbend.paradox.apidoc.ApidocPlugin.autoImport.apidocRootPackage
import sbt.librarymanagement.SemanticSelector
import sbt.librarymanagement.VersionNumber
inThisBuild(Def.settings(
organization := "com.typesafe.akka",
organizationName := "Lightbend",
organizationHomepage := Some(url("https://www.lightbend.com")),
homepage := Some(url("https://akka.io")),
apiURL := {
val apiVersion = if (isSnapshot.value) "current" else version.value
Some(url(s"https://doc.akka.io/api/akka-http/$apiVersion/"))
},
scmInfo := Some(
ScmInfo(url("https://github.com/akka/akka-http"), "[email protected]:akka/akka-http.git")),
developers := List(
Developer("contributors", "Contributors", "[email protected]",
url("https://github.com/akka/akka-http/graphs/contributors"))
),
startYear := Some(2014),
releaseNotesURL := (
if (isSnapshot.value) None
else Some(url(s"https://github.com/akka/akka-http/releases/tag/v${version.value}"))
),
licenses := {
val tagOrBranch =
if (isSnapshot.value) "main"
else "v" + version.value
Seq(("BUSL-1.1", url(s"https://github.com/akka/akka-http/blob/${tagOrBranch}/LICENSE.txt")))
},
description := "Akka Http: Modern, fast, asynchronous, streaming-first HTTP server and client.",
testOptions ++= Seq(
Tests.Argument(TestFrameworks.JUnit, "-q", "-v"),
Tests.Argument(TestFrameworks.ScalaTest, "-oDF")
),
Dependencies.Versions,
Formatting.formatSettings,
shellPrompt := { s => Project.extract(s).currentProject.id + " > " },
concurrentRestrictions in Global += Tags.limit(Tags.Test, 1),
onLoad in Global := {
sLog.value.info(s"Building Akka HTTP ${version.value} against Akka ${AkkaDependency.akkaVersion} on Scala ${(httpCore / scalaVersion).value}")
(onLoad in Global).value
}
))
// When this is updated the set of modules in Http.allModules should also be updated
lazy val userProjects: Seq[ProjectReference] = List[ProjectReference](
parsing,
httpCore,
http2Tests,
http,
httpCaching,
httpTestkit,
httpMarshallersScala,
httpMarshallersJava,
httpSprayJson,
httpXml,
httpJackson,
httpJwt,
httpScalafixRules, // don't aggregate tests for now as this will break with Scala compiler updates too easily
)
lazy val aggregatedProjects: Seq[ProjectReference] = userProjects ++ List[ProjectReference](
httpTests,
docs,
compatibilityTests,
httpJmhBench,
billOfMaterials
)
lazy val root = Project(
id = "akka-http-root",
base = file(".")
)
.enablePlugins(UnidocRoot, NoPublish, PublishRsyncPlugin, NoScala3)
.disablePlugins(
MimaPlugin,
com.geirsson.CiReleasePlugin) // we use publishSigned, but use a pgp utility from CiReleasePlugin
.settings(
// Unidoc doesn't like macro definitions
unidocProjectExcludes := Seq(parsing, compatibilityTests, docs, httpTests, httpJmhBench, httpScalafix, httpScalafixRules, httpScalafixTestInput, httpScalafixTestOutput, httpScalafixTests),
// Support applying macros in unidoc:
scalaMacroSupport,
Compile / headerCreate / unmanagedSources := (baseDirectory.value / "project").**("*.scala").get,
publishRsyncArtifacts := {
val unidocArtifacts = (Compile / unidoc).value
// unidoc returns a Seq[File] which contains directories of generated API docs, one for
// Java, one for Scala. It's not specified which is which, though.
// We currently expect the java documentation at akka-http/target/javaunidoc, so
// the following heuristic is hopefully good enough to determine which one is the Java and
// which one the Scala version.
// This will fail with a MatchError when -Dakka.genjavadoc.enabled is not set
val (Seq(java), Seq(scala)) = unidocArtifacts.partition(_.getName contains "java")
Seq(
scala -> gustavDir("api").value,
java -> gustavDir("japi").value)
}
)
.aggregate(aggregatedProjects: _*)
/**
* Adds a `src/.../scala-2.13+` source directory for Scala 2.13 and newer
* FIXME `scala-2.13+` can be consolidated in later cleanup after the removal of Scala 2.12
*/
def add213CrossDirs(config: Configuration): Seq[Setting[_]] = Seq(
config / unmanagedSourceDirectories += {
val sourceDir = (config / sourceDirectory).value
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((e, n)) if e > 2 || (e == 2 && n >= 13) => sourceDir / "scala-2.13+"
case _ =>
throw new IllegalArgumentException(s"Unsupported Scala version [${scalaVersion.value}]")
}
}
)
val commonSettings =
add213CrossDirs(Compile) ++
add213CrossDirs(Test)
val scalaMacroSupport = Seq(
scalacOptions ++= {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n >= 13 =>
Seq("-Ymacro-annotations")
case _ =>
Seq.empty
}
}
)
lazy val parsing = project("akka-parsing")
.settings(commonSettings)
.settings(AutomaticModuleName.settings("akka.http.parsing"))
.addAkkaModuleDependency("akka-actor", "provided")
.settings(Dependencies.parsing)
.settings(
scalacOptions --= Seq("-Xfatal-warnings", "-Xlint", "-Ywarn-dead-code"), // disable warnings for parboiled code
scalacOptions += "-language:_",
)
.settings(scalaMacroSupport)
.enablePlugins(ScaladocNoVerificationOfDiagrams)
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(MimaPlugin)
lazy val httpCore = project("akka-http-core")
.settings(commonSettings)
.settings(AutomaticModuleName.settings("akka.http.core"))
.dependsOn(parsing/*, httpScalafixRules % ScalafixConfig*/)
.addAkkaModuleDependency("akka-stream", "provided")
.addAkkaModuleDependency(
"akka-stream-testkit",
"test",
akka =
if (System.getProperty("akka.http.test-against-akka-main", "false") == "true") AkkaDependency.mainSnapshot
else AkkaDependency.default
)
.settings(Dependencies.httpCore)
.settings(VersionGenerator.versionSettings)
.settings(scalaMacroSupport)
.enablePlugins(BootstrapGenjavadoc)
.enablePlugins(ReproducibleBuildsPlugin)
.enablePlugins(Pre213Preprocessor).settings(
akka.http.sbt.Pre213Preprocessor.pre213Files := Seq(
"headers.scala", "HttpMessage.scala", "LanguageRange.scala", "CacheDirective.scala", "LinkValue.scala"
)
)
.disablePlugins(ScalafixPlugin)
lazy val http = project("akka-http")
.settings(commonSettings)
.settings(AutomaticModuleName.settings("akka.http"))
.dependsOn(httpCore)
.addAkkaModuleDependency("akka-stream", "provided")
.addAkkaModuleDependency("akka-pki")
.settings(Dependencies.http)
.settings(
Compile / scalacOptions += "-language:_"
)
.settings(scalaMacroSupport)
.enablePlugins(Pre213Preprocessor).settings(
akka.http.sbt.Pre213Preprocessor.pre213Files := Seq(
"scaladsl/server/directives/FormFieldDirectives.scala", "scaladsl/server/directives/RespondWithDirectives.scala"
)
)
.enablePlugins(BootstrapGenjavadoc, BoilerplatePlugin)
.enablePlugins(ReproducibleBuildsPlugin)
def gustavDir(kind: String) = Def.task {
val ver =
if (isSnapshot.value) "snapshot"
else version.value
s"www/$kind/akka-http/$ver"
}
lazy val http2Tests = project("akka-http2-tests")
.settings(commonSettings)
.settings(AutomaticModuleName.settings("akka.http.http2"))
.dependsOn(httpCore, httpTestkit % "test", httpCore % "test->test")
.addAkkaModuleDependency("akka-stream", "provided")
.addAkkaModuleDependency("akka-stream-testkit", "test")
.settings(Dependencies.http2)
.settings(Dependencies.http2Tests)
.settings {
lazy val h2specPath = Def.task {
(Test / target).value / h2specName / h2specExe
}
Seq(
Test / run / fork := true,
Test / fork := true,
Test / run / sbt.Keys.connectInput := true,
Test / javaOptions += "-Dh2spec.path=" + h2specPath.value,
Test / resourceGenerators += Def.task {
val log = streams.value.log
val h2spec = h2specPath.value
if (!h2spec.exists) {
log.info("Extracting h2spec to " + h2spec)
for (zip <- (Test / update).value.select(artifact = artifactFilter(name = h2specName, extension = "zip")))
IO.unzip(zip, (Test / target).value)
// Set the executable bit on the expected path to fail if it doesn't exist
for (view <- Option(Files.getFileAttributeView(h2spec.toPath, classOf[PosixFileAttributeView]))) {
val permissions = view.readAttributes.permissions
if (permissions.add(PosixFilePermission.OWNER_EXECUTE))
view.setPermissions(permissions)
}
}
Seq(h2spec)
}
)
}
.enablePlugins(BootstrapGenjavadoc)
.enablePlugins(ReproducibleBuildsPlugin)
.enablePlugins(NoPublish) // only contains tests, don't release tests
.disablePlugins(MimaPlugin) // experimental module still
lazy val httpTestkit = project("akka-http-testkit")
.settings(commonSettings)
.settings(AutomaticModuleName.settings("akka.http.testkit"))
.dependsOn(http)
.addAkkaModuleDependency("akka-stream-testkit", "provided")
.addAkkaModuleDependency("akka-testkit", "provided")
.settings(Dependencies.httpTestkit)
.settings(
// don't ignore Suites which is the default for the junit-interface
testOptions += Tests.Argument(TestFrameworks.JUnit, "--ignore-runners="),
Compile / scalacOptions ++= Seq("-language:_"),
Test / run / mainClass := Some("akka.http.javadsl.SimpleServerApp")
)
.enablePlugins(BootstrapGenjavadoc, MultiNodeScalaTest, ScaladocNoVerificationOfDiagrams)
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(MimaPlugin) // testkit, no bin compat guaranteed
lazy val httpTests = project("akka-http-tests")
.settings(commonSettings)
.settings(Dependencies.httpTests)
.dependsOn(httpSprayJson, httpXml, httpJackson,
httpTestkit % "test", httpCore % "test->test",
httpScalafixRules % ScalafixConfig)
.enablePlugins(NoPublish) // don't release tests
.enablePlugins(MultiNode)
.disablePlugins(MimaPlugin) // this is only tests
.configs(MultiJvm)
.settings(headerSettings(MultiJvm))
.settings(AkkaHttpValidatePullRequest.additionalTasks += MultiJvm / headerCheck)
.addAkkaModuleDependency("akka-stream", "provided")
.addAkkaModuleDependency("akka-multi-node-testkit", "test")
.settings(
// Fix to reenable scala-steward, see https://gitter.im/scala-steward-org/scala-steward?at=6183bb66d78911028a1b7cd8
// Putting that jar file with the complicated name into the git tree directly breaks if something in the environment
// has unicode path names configured wrongly. So, we wrap it into an extra zip file which is extracted before
// tests are run.
Test / unmanagedJars += {
val targetDir = target.value / "extra-libs"
val targetFile = targetDir / "i have späces.jar"
if (!targetFile.exists) {
val zipFile = (Test / sourceDirectory).value / "extra-libs.zip"
IO.unzip(zipFile, targetDir)
}
targetFile
}
)
lazy val httpJmhBench = project("akka-http-bench-jmh")
.settings(commonSettings)
.dependsOn(http, http2Tests % "compile->compile,test")
.addAkkaModuleDependency("akka-stream")
.enablePlugins(JmhPlugin)
.enablePlugins(NoPublish) // don't release benchs
.disablePlugins(MimaPlugin)
lazy val httpMarshallersScala = project("akka-http-marshallers-scala")
.settings(commonSettings)
.enablePlugins(NoPublish /*, AggregatePRValidation*/)
.disablePlugins(MimaPlugin)
.aggregate(httpSprayJson, httpXml)
lazy val httpXml =
httpMarshallersScalaSubproject("xml")
.settings(AutomaticModuleName.settings("akka.http.marshallers.scalaxml"))
.addAkkaModuleDependency("akka-stream", "provided")
.settings(Dependencies.httpXml)
lazy val httpSprayJson =
httpMarshallersScalaSubproject("spray-json")
.settings(AutomaticModuleName.settings("akka.http.marshallers.sprayjson"))
.addAkkaModuleDependency("akka-stream", "provided")
.settings(Dependencies.httpSprayJson)
lazy val httpMarshallersJava = project("akka-http-marshallers-java")
.settings(commonSettings)
.enablePlugins(NoPublish /*, AggregatePRValidation*/)
.disablePlugins(MimaPlugin)
.aggregate(httpJackson)
lazy val httpJackson =
httpMarshallersJavaSubproject("jackson")
.settings(AutomaticModuleName.settings("akka.http.marshallers.jackson"))
.addAkkaModuleDependency("akka-stream", "provided")
.addAkkaModuleDependency("akka-stream-testkit", "test")
.dependsOn(httpTestkit % "test")
.settings(Dependencies.httpJackson)
.enablePlugins(ScaladocNoVerificationOfDiagrams)
lazy val httpJwt = project("akka-http-jwt")
.settings(commonSettings)
.settings(AutomaticModuleName.settings("akka.http.jwt"))
.addAkkaModuleDependency("akka-pki", "provided")
.addAkkaModuleDependency("akka-stream", "provided")
.addAkkaModuleDependency("akka-testkit", "provided")
.settings(Dependencies.httpJwt)
.dependsOn(http, httpCore, httpTestkit % "test")
.enablePlugins(BootstrapGenjavadoc)
lazy val httpCaching = project("akka-http-caching")
.settings(commonSettings)
.settings(AutomaticModuleName.settings("akka.http.caching"))
.addAkkaModuleDependency("akka-stream", "provided")
.addAkkaModuleDependency("akka-stream-testkit", "provided")
.settings(Dependencies.httpCaching)
.dependsOn(http, httpCore, httpTestkit % "test")
.enablePlugins(BootstrapGenjavadoc)
def project(name: String) =
Project(id = name, base = file(name))
.disablePlugins(com.geirsson.CiReleasePlugin) // we use publishSigned, but use a pgp utility from CiReleasePlugin
def httpMarshallersScalaSubproject(name: String) =
Project(
id = s"akka-http-$name",
base = file(s"akka-http-marshallers-scala/akka-http-$name")
)
.dependsOn(http)
.settings(commonSettings)
.enablePlugins(BootstrapGenjavadoc)
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(com.geirsson.CiReleasePlugin)
def httpMarshallersJavaSubproject(name: String) =
Project(
id = s"akka-http-$name",
base = file(s"akka-http-marshallers-java/akka-http-$name"),
)
.dependsOn(http)
.settings(commonSettings)
.enablePlugins(BootstrapGenjavadoc)
.enablePlugins(ReproducibleBuildsPlugin)
.disablePlugins(com.geirsson.CiReleasePlugin)
lazy val httpScalafix = project("akka-http-scalafix")
.enablePlugins(NoPublish, NoScala3)
.disablePlugins(MimaPlugin)
.aggregate(httpScalafixRules, httpScalafixTestInput, httpScalafixTestOutput, httpScalafixTests)
lazy val httpScalafixRules =
Project(id = "akka-http-scalafix-rules", base = file("akka-http-scalafix/scalafix-rules"))
.settings(
libraryDependencies += Dependencies.Compile.scalafix,
)
.enablePlugins(NoScala3)
.disablePlugins(MimaPlugin) // tooling, no bin compat guaranteed
.disablePlugins(com.geirsson.CiReleasePlugin)
lazy val httpScalafixTestInput =
Project(id = "akka-http-scalafix-test-input", base = file("akka-http-scalafix/scalafix-test-input"))
.dependsOn(http)
.addAkkaModuleDependency("akka-stream")
.enablePlugins(NoPublish, NoScala3)
.disablePlugins(MimaPlugin, HeaderPlugin /* because it gets confused about metaheader required for tests */)
.disablePlugins(com.geirsson.CiReleasePlugin)
.settings(
addCompilerPlugin(scalafixSemanticdb),
scalacOptions ++= List(
"-Yrangepos",
"-P:semanticdb:synthetics:on"
),
scalacOptions := scalacOptions.value.filterNot(Set("-deprecation", "-Xlint").contains(_)), // we expect deprecated stuff in there
)
lazy val httpScalafixTestOutput =
Project(id = "akka-http-scalafix-test-output", base = file("akka-http-scalafix/scalafix-test-output"))
.dependsOn(http)
.addAkkaModuleDependency("akka-stream")
.enablePlugins(NoPublish, NoScala3)
.disablePlugins(MimaPlugin, HeaderPlugin /* because it gets confused about metaheader required for tests */)
.disablePlugins(com.geirsson.CiReleasePlugin)
lazy val httpScalafixTests =
Project(id = "akka-http-scalafix-tests", base = file("akka-http-scalafix/scalafix-tests"))
.enablePlugins(NoPublish, NoScala3)
.disablePlugins(MimaPlugin)
.disablePlugins(com.geirsson.CiReleasePlugin)
.settings(
publish / skip := true,
libraryDependencies += "ch.epfl.scala" % "scalafix-testkit" % Dependencies.scalafixVersion % Test cross CrossVersion.full,
Compile / compile :=
(Compile / compile).dependsOn(httpScalafixTestInput / Compile /compile).value,
scalafixTestkitOutputSourceDirectories :=
(httpScalafixTestOutput / Compile / sourceDirectories).value,
scalafixTestkitInputSourceDirectories :=
(httpScalafixTestInput / Compile / sourceDirectories).value,
scalafixTestkitInputClasspath :=
(httpScalafixTestInput / Compile / fullClasspath).value,
)
.dependsOn(httpScalafixRules)
.enablePlugins(ScalafixTestkitPlugin)
lazy val docs = project("docs")
.enablePlugins(AkkaParadoxPlugin, NoPublish, PublishRsyncPlugin)
.disablePlugins(MimaPlugin)
.addAkkaModuleDependency("akka-stream", "provided", AkkaDependency.docs)
.addAkkaModuleDependency("akka-actor-typed", "provided", AkkaDependency.docs)
.addAkkaModuleDependency("akka-multi-node-testkit", "provided", AkkaDependency.docs)
.addAkkaModuleDependency("akka-stream-testkit", "provided", AkkaDependency.docs)
.addAkkaModuleDependency("akka-actor-testkit-typed", "provided", AkkaDependency.docs)
.dependsOn(
httpCore, http, httpXml, http2Tests, httpMarshallersJava, httpMarshallersScala, httpCaching, httpJwt,
httpTests % "compile;test->test", httpTestkit % "compile;test->test", httpScalafixRules % ScalafixConfig
)
.settings(Dependencies.docs)
.settings(
name := "akka-http-docs",
resolvers += Resolver.jcenterRepo,
scalacOptions ++= Seq(
// Make sure we don't accidentally keep documenting deprecated calls
"-Xfatal-warnings",
// Does not appear to lead to problems
"-Wconf:msg=The outer reference in this type test cannot be checked at run time:s",
),
scalacOptions ++= (
if (scalaVersion.value.startsWith("3")) Seq.empty
else Seq(
// In docs adding an unused variable can be helpful, for example
// to show its type
"-Xlint:-unused"
)
),
scalacOptions --= Seq(
// Code after ??? can be considered 'dead', but still useful for docs
"-Ywarn-dead-code",
),
(Compile / paradoxProcessor) := {
import scala.concurrent.duration._
import com.lightbend.paradox.ParadoxProcessor
import com.lightbend.paradox.markdown.{ Reader, Writer }
// FIXME: use `paradoxParsingTimeout` when https://github.com/lightbend/paradox/pull/447 has been released
new ParadoxProcessor(
reader = new Reader(maxParsingTime = 10.seconds),
writer = new Writer(serializerPlugins = Writer.defaultPlugins(paradoxDirectives.value)))
},
paradoxGroups := Map("Language" -> Seq("Scala", "Java")),
paradoxRoots := List(
"index.html",
"quickstart-java/index.html",
"quickstart-scala/index.html"),
Compile / paradoxProperties ++= Map(
"project.name" -> "Akka HTTP",
"canonical.base_url" -> "https://doc.akka.io/libraries/akka-http/current",
"akka.version" -> AkkaDependency.docs.version,
"akka.minimum.version" -> AkkaDependency.minimumExpectedAkkaVersion,
"jackson.xml.version" -> Dependencies.jacksonXmlVersion,
"scalafix.version" -> _root_.scalafix.sbt.BuildInfo.scalafixVersion, // grab from scalafix plugin directly
"extref.akka-docs.base_url" -> s"https://doc.akka.io/libraries/akka-core/${AkkaDependency.docs.link}/%s",
"javadoc.akka.http.base_url" -> {
val v = if (isSnapshot.value) "current" else version.value
s"https://doc.akka.io/japi/akka-http/$v"
},
"javadoc.akka.base_url" -> s"https://doc.akka.io/japi/akka/${AkkaDependency.docs.link}",
"javadoc.akka.link_style" -> "direct",
"scaladoc.akka.http.base_url" -> {
val v = if (isSnapshot.value) "current" else version.value
s"https://doc.akka.io/api/akka-http/$v"
},
"scaladoc.akka.base_url" -> s"https://doc.akka.io/api/akka/${AkkaDependency.docs.link}",
"algolia.docsearch.app_id" -> "XUXZ6LW9B1",
"algolia.docsearch.api_key" -> "5b6260148e92f7c5e38338fcf7eaa3e0",
"algolia.docsearch.index_name" -> "akka_http_docs",
"google.analytics.account" -> "UA-21117439-1",
"google.analytics.domain.name" -> "akka.io",
"github.base_url" -> GitHub.url(version.value, isSnapshot.value),
),
apidocRootPackage := "akka",
Formatting.docFormatSettings,
ThisBuild / publishRsyncHost := "[email protected]",
publishRsyncArtifacts := List((Compile / paradox).value -> gustavDir("libraries").value),
)
.settings(ParadoxSupport.paradoxWithCustomDirectives)
lazy val compatibilityTests = Project("akka-http-compatibility-tests", file("akka-http-compatibility-tests"))
.enablePlugins(NoPublish)
.disablePlugins(MimaPlugin)
.disablePlugins(com.geirsson.CiReleasePlugin)
.addAkkaModuleDependency("akka-stream", "provided")
.settings(
libraryDependencies +=(
// no scala 3 native artifact available yet so use 2.13
// FIXME remove if-else once artifact with 3 is published
if (scalaBinaryVersion.value == "3") ("com.typesafe.akka" %% "akka-http" % MiMa.latest102Version % "provided").cross(CrossVersion.for3Use2_13)
else "com.typesafe.akka" %% "akka-http" % MiMa.latest102Version % "provided"
),
(Test / dependencyClasspath) := {
// HACK: We'd like to use `dependsOn(http % "test->compile")` to upgrade the explicit dependency above to the
// current version but that fails. So, this is a manual `dependsOn` which works as expected.
(Test / dependencyClasspath).value.filterNot(_.data.getName contains "akka") ++
(httpTests / Test / fullClasspath).value
},
)
lazy val billOfMaterials = Project("bill-of-materials", file("akka-http-bill-of-materials"))
.enablePlugins(BillOfMaterialsPlugin)
.disablePlugins(MimaPlugin)
.disablePlugins(com.geirsson.CiReleasePlugin)
.settings(
name := "akka-http-bom",
bomIncludeProjects := userProjects,
)
def hasCommitsAfterTag(description: Option[GitDescribeOutput]): Boolean = description.get.commitSuffix.distance > 0
val isJdk11orHigher: Boolean = {
val result = VersionNumber(sys.props("java.specification.version")).matchesSemVer(SemanticSelector(">=11"))
if (!result)
throw new IllegalArgumentException("JDK 11 or higher is required")
result
}