2023-01-08 17:13:31 +08:00
|
|
|
/*
|
|
|
|
|
* 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
|
|
|
|
|
*
|
2023-06-22 14:19:26 +01:00
|
|
|
* This file is part of the Apache Pekko project, which was derived from Akka.
|
2023-01-08 17:13:31 +08:00
|
|
|
*/
|
|
|
|
|
|
2019-09-09 05:25:33 -07:00
|
|
|
/*
|
2022-02-04 12:36:44 +01:00
|
|
|
* Copyright (C) 2019-2022 Lightbend Inc. <https://www.lightbend.com>
|
2019-09-09 05:25:33 -07:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
import com.lightbend.paradox.sbt.ParadoxPlugin
|
|
|
|
|
import com.lightbend.paradox.sbt.ParadoxPlugin.autoImport._
|
|
|
|
|
import com.lightbend.paradox.apidoc.ApidocPlugin
|
2023-06-13 15:19:37 +02:00
|
|
|
import com.lightbend.paradox.projectinfo.ParadoxProjectInfoPluginKeys.projectInfoVersion
|
2023-02-10 09:55:33 +01:00
|
|
|
import org.apache.pekko.PekkoParadoxPlugin.autoImport._
|
2019-09-09 05:25:33 -07:00
|
|
|
import sbt.Keys._
|
|
|
|
|
import sbt._
|
2023-04-21 16:20:42 +02:00
|
|
|
import sbtlicensereport.SbtLicenseReport.autoImportImpl.dumpLicenseReportAggregate
|
2019-09-09 05:25:33 -07:00
|
|
|
|
2021-08-23 14:08:51 -04:00
|
|
|
import scala.concurrent.duration._
|
|
|
|
|
|
2019-09-09 05:25:33 -07:00
|
|
|
object Paradox {
|
2023-01-31 12:26:50 +01:00
|
|
|
val pekkoBaseURL = "https://pekko.apache.org"
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val propertiesSettings = Seq(
|
2019-09-09 05:25:33 -07:00
|
|
|
Compile / paradoxProperties ++= Map(
|
2023-01-31 12:26:50 +01:00
|
|
|
"canonical.base_url" -> s"$pekkoBaseURL/docs/pekko/current",
|
2019-09-09 05:25:33 -07:00
|
|
|
"github.base_url" -> GitHub
|
|
|
|
|
.url(version.value), // for links like this: @github[#1](#1) or @github[83986f9](83986f9)
|
2023-01-31 12:26:50 +01:00
|
|
|
"extref.pekko.http.base_url" -> s"$pekkoBaseURL/docs/pekko-http/current/%s",
|
|
|
|
|
"extref.pekko-management.base_url" -> s"$pekkoBaseURL/docs/pekko-management/current/%s",
|
2020-11-30 20:00:39 +01:00
|
|
|
"extref.platform-guide.base_url" -> "https://developer.lightbend.com/docs/akka-platform-guide/%s",
|
2019-09-09 05:25:33 -07:00
|
|
|
"extref.wikipedia.base_url" -> "https://en.wikipedia.org/wiki/%s",
|
|
|
|
|
"extref.github.base_url" -> (GitHub.url(version.value) + "/%s"), // for links to our sources
|
2023-04-14 13:54:23 +02:00
|
|
|
"extref.samples.base_url" -> s"$pekkoBaseURL/docs/pekko-samples/current/%s",
|
2023-01-31 12:26:50 +01:00
|
|
|
"pekko.doc.dns" -> s"$pekkoBaseURL",
|
2023-06-13 15:19:37 +02:00
|
|
|
"scaladoc.pekko.base_url" -> s"$pekkoBaseURL/api/pekko/${projectInfoVersion.value}/org/apache",
|
2023-01-31 12:26:50 +01:00
|
|
|
"scaladoc.pekko.http.base_url" -> s"$pekkoBaseURL/api/pekko-http/current/org/apache",
|
2023-06-13 15:19:37 +02:00
|
|
|
"scaladoc.org.apache.pekko.base_url" -> s"$pekkoBaseURL/api/pekko/${projectInfoVersion.value}",
|
|
|
|
|
"scaladoc.org.apache.pekko.http.base_url" -> s"$pekkoBaseURL/api/pekko-http/current",
|
2019-12-05 16:40:05 +01:00
|
|
|
"javadoc.java.base_url" -> "https://docs.oracle.com/en/java/javase/11/docs/api/java.base/",
|
|
|
|
|
"javadoc.java.link_style" -> "direct",
|
2023-06-13 15:19:37 +02:00
|
|
|
"javadoc.pekko.base_url" -> s"$pekkoBaseURL/japi/pekko/${projectInfoVersion.value}/org/apache",
|
2022-11-12 10:21:24 +01:00
|
|
|
"javadoc.pekko.link_style" -> "direct",
|
2023-02-22 12:48:15 +01:00
|
|
|
"javadoc.pekko.http.base_url" -> s"$pekkoBaseURL/japi/pekko-http/current/org/apache",
|
|
|
|
|
"javadoc.pekko.http.link_style" -> "frames",
|
2023-06-13 15:19:37 +02:00
|
|
|
"javadoc.org.apache.pekko.base_url" -> s"$pekkoBaseURL/japi/pekko/${projectInfoVersion.value}",
|
|
|
|
|
"javadoc.org.apache.pekko.link_style" -> "direct",
|
|
|
|
|
"javadoc.org.apache.pekko.http.base_url" -> s"$pekkoBaseURL/japi/pekko-http/current",
|
|
|
|
|
"javadoc.org.apache.pekko.http.link_style" -> "frames",
|
2022-01-24 14:27:50 +02:00
|
|
|
"javadoc.com.fasterxml.jackson.annotation.base_url" -> "https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-annotations/latest/",
|
|
|
|
|
"javadoc.com.fasterxml.jackson.annotation.link_style" -> "direct",
|
|
|
|
|
"javadoc.com.fasterxml.jackson.databind.base_url" -> "https://javadoc.io/doc/com.fasterxml.jackson.core/jackson-databind/latest/",
|
|
|
|
|
"javadoc.com.fasterxml.jackson.databind.link_style" -> "direct",
|
2022-03-03 20:50:39 +02:00
|
|
|
"javadoc.com.google.protobuf.base_url" -> "https://javadoc.io/doc/com.google.protobuf/protobuf-java/latest/",
|
|
|
|
|
"javadoc.com.google.protobuf.link_style" -> "direct",
|
2022-04-04 16:21:49 +03:00
|
|
|
"javadoc.com.typesafe.config.base_url" -> "https://javadoc.io/doc/com.typesafe/config/latest/",
|
|
|
|
|
"javadoc.com.typesafe.config.link_style" -> "direct",
|
2022-04-21 14:38:38 +03:00
|
|
|
"javadoc.org.slf4j.base_url" -> "https://www.javadoc.io/doc/org.slf4j/slf4j-api/latest/org.slf4j",
|
|
|
|
|
"javadoc.org.slf4j.link_style" -> "direct",
|
2019-09-09 05:25:33 -07:00
|
|
|
"scala.version" -> scalaVersion.value,
|
2020-05-06 11:06:55 +02:00
|
|
|
"scala.binary.version" -> scalaBinaryVersion.value,
|
2022-12-02 04:53:48 -08:00
|
|
|
"pekko.version" -> version.value,
|
2023-06-13 22:44:13 +02:00
|
|
|
"scalatest.version" -> Dependencies.scalaTestVersion,
|
2019-09-09 05:25:33 -07:00
|
|
|
"sigar_loader.version" -> "1.6.6-rev002",
|
|
|
|
|
"aeron_version" -> Dependencies.aeronVersion,
|
2019-09-17 17:26:13 +02:00
|
|
|
"netty_version" -> Dependencies.nettyVersion,
|
|
|
|
|
"logback_version" -> Dependencies.logbackVersion))
|
2019-09-09 05:25:33 -07:00
|
|
|
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val rootsSettings = Seq(
|
2019-09-09 05:25:33 -07:00
|
|
|
paradoxRoots := List(
|
|
|
|
|
"index.html",
|
|
|
|
|
// TODO page not linked to
|
|
|
|
|
"fault-tolerance-sample.html"))
|
|
|
|
|
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val themeSettings = Seq(
|
2023-03-02 01:19:58 +01:00
|
|
|
pekkoParadoxGithub := Some("https://github.com/apache/incubator-pekko"))
|
2023-02-10 09:55:33 +01:00
|
|
|
|
2019-09-09 05:25:33 -07:00
|
|
|
// FIXME https://github.com/lightbend/paradox/issues/350
|
|
|
|
|
// Exclusions from direct compilation for includes dirs/files not belonging in a TOC
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val includesSettings = Seq(
|
2019-09-09 05:25:33 -07:00
|
|
|
(Compile / paradoxMarkdownToHtml / excludeFilter) := (Compile / paradoxMarkdownToHtml / excludeFilter).value ||
|
|
|
|
|
ParadoxPlugin.InDirectoryFilter((Compile / paradox / sourceDirectory).value / "includes"),
|
|
|
|
|
// Links are interpreted relative to the page the snippet is included in,
|
|
|
|
|
// instead of relative to the place where the snippet is declared.
|
|
|
|
|
(Compile / paradoxMarkdownToHtml / excludeFilter) := (Compile / paradoxMarkdownToHtml / excludeFilter).value ||
|
|
|
|
|
ParadoxPlugin.InDirectoryFilter((Compile / paradox / sourceDirectory).value / "includes.html"))
|
|
|
|
|
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val groupsSettings = Seq(Compile / paradoxGroups := Map("Language" -> Seq("Scala", "Java")))
|
2019-09-09 05:25:33 -07:00
|
|
|
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val parsingSettings = Seq(Compile / paradoxParsingTimeout := 5.seconds)
|
2021-08-23 14:08:51 -04:00
|
|
|
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val sourceGeneratorSettings = Seq(
|
2023-04-21 16:20:42 +02:00
|
|
|
Compile / paradoxMarkdownToHtml / sourceGenerators += Def.taskDyn {
|
|
|
|
|
val targetFile = (Compile / paradox / sourceManaged).value / "project" / "license-report.md"
|
|
|
|
|
|
|
|
|
|
(LocalRootProject / dumpLicenseReportAggregate).map { dir =>
|
|
|
|
|
IO.copy(List(dir / "pekko-root-licenses.md" -> targetFile)).toList
|
|
|
|
|
}
|
|
|
|
|
}.taskValue)
|
|
|
|
|
|
2024-01-22 07:15:16 +01:00
|
|
|
lazy val settings =
|
2019-09-09 05:25:33 -07:00
|
|
|
propertiesSettings ++
|
|
|
|
|
rootsSettings ++
|
|
|
|
|
includesSettings ++
|
|
|
|
|
groupsSettings ++
|
2021-08-23 14:08:51 -04:00
|
|
|
parsingSettings ++
|
2023-02-10 09:55:33 +01:00
|
|
|
themeSettings ++
|
2023-04-21 16:20:42 +02:00
|
|
|
sourceGeneratorSettings ++
|
2019-09-09 05:25:33 -07:00
|
|
|
Seq(
|
2023-01-05 11:10:50 +01:00
|
|
|
Compile / paradox / name := "Pekko",
|
2023-05-23 18:34:30 +01:00
|
|
|
ApidocPlugin.autoImport.apidocRootPackage := "org.apache.pekko")
|
2019-09-09 05:25:33 -07:00
|
|
|
}
|