Skip to content

Commit

Permalink
build: Build and publish scaladocs for runtime module (#1868)
Browse files Browse the repository at this point in the history
  • Loading branch information
johanandren authored Nov 1, 2023
1 parent 323962c commit 2372c62
Showing 1 changed file with 19 additions and 2 deletions.
21 changes: 19 additions & 2 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import akka.grpc.Dependencies
import akka.grpc.Dependencies.Versions.{ scala212, scala213 }
import akka.grpc.ProjectExtensions._
import akka.grpc.build.ReflectiveCodeGen
import com.typesafe.tools.mima.core._
import sbt.Keys.scalaVersion
import com.geirsson.CiReleasePlugin
import com.typesafe.sbt.site.util.SiteHelpers

val akkaGrpcRuntimeName = "akka-grpc-runtime"

Expand Down Expand Up @@ -176,11 +176,20 @@ lazy val benchmarks = Project(id = "benchmarks", base = file("benchmarks"))
scalaVersion := Dependencies.Versions.CrossScalaForLib.head,
(publish / skip) := true)

// Config to allow only building scaladocs for runtime module but in/from the docs module
val AkkaGrpcRuntime = config("akkaGrpcRuntime")

lazy val docs = Project(id = "akka-grpc-docs", base = file("docs"))
// Make sure code generation is ran:
.dependsOn(pluginTesterScala)
.dependsOn(pluginTesterJava)
.enablePlugins(SitePreviewPlugin, AkkaParadoxPlugin, ParadoxSitePlugin, PreprocessPlugin, PublishRsyncPlugin)
.enablePlugins(
SitePreviewPlugin,
AkkaParadoxPlugin,
ParadoxSitePlugin,
PreprocessPlugin,
PublishRsyncPlugin,
SiteScaladocPlugin)
.disablePlugins(MimaPlugin, CiReleasePlugin)
.settings(
name := "Akka gRPC",
Expand Down Expand Up @@ -219,6 +228,14 @@ lazy val docs = Project(id = "akka-grpc-docs", base = file("docs"))
.settings(
crossScalaVersions := Dependencies.Versions.CrossScalaForLib,
scalaVersion := Dependencies.Versions.CrossScalaForLib.head)
.settings(
// only the publish API docs for the runtime, inlined instead of using SiteScaladocPlugin.scaladocSettings
// to be able to reference the `projectInfoVersion` in the sub dir path
inConfig(AkkaGrpcRuntime)(
Seq(
siteSubdirName := s"api/akka-grpc/${projectInfoVersion.value}",
mappings := (runtime / Compile / packageDoc / mappings).value)) ++
SiteHelpers.addMappingsToSiteDir(AkkaGrpcRuntime / mappings, AkkaGrpcRuntime / siteSubdirName))

lazy val pluginTesterScala = Project(id = "akka-grpc-plugin-tester-scala", base = file("plugin-tester-scala"))
.disablePlugins(MimaPlugin, CiReleasePlugin)
Expand Down

0 comments on commit 2372c62

Please sign in to comment.