Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: Build and publish scaladocs for runtime module #1868

Merged
merged 3 commits into from
Nov 1, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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