Skip to content

Commit

Permalink
Automatically set tlSiteApiModule from unidoc plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
armanbilge committed Mar 1, 2022
1 parent 46bf8ef commit 0e013b4
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,6 @@ lazy val docs = project
.enablePlugins(TypelevelSitePlugin)
.settings(
laikaConfig ~= { _.withRawContent },
tlSiteApiModule := Some((unidoc / projectID).value),
tlSiteApiPackage := Some("org.typelevel.sbt"),
tlSiteRelatedProjects := Seq(
"sbt" -> url("https://www.scala-sbt.org/"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ object TypelevelSitePlugin extends AutoPlugin {
settingKey[ThemeProvider]("The Typelevel Helium extensions")
lazy val tlSiteApiUrl = settingKey[Option[URL]]("URL to the API docs")
lazy val tlSiteApiModule =
settingKey[Option[ModuleID]]("The project that publishes API docs")
settingKey[Option[ModuleID]]("The module that publishes API docs")
lazy val tlSiteApiPackage = settingKey[Option[String]](
"The top-level package for your API docs (e.g. org.typlevel.sbt)")
lazy val tlSiteRelatedProjects =
Expand Down Expand Up @@ -75,10 +75,13 @@ object TypelevelSitePlugin extends AutoPlugin {
override def requires =
MdocPlugin && LaikaPlugin && TypelevelGitHubPlugin && GenerativePlugin && NoPublishPlugin

override def globalSettings = Seq(
tlSiteApiModule := None
)

override def buildSettings = Seq(
tlSitePublishBranch := Some("main"),
tlSiteApiUrl := None,
tlSiteApiModule := None,
tlSiteApiPackage := None,
tlSiteRelatedProjects := Seq(TypelevelProject.Cats),
tlSiteKeepFiles := true,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ object TypelevelUnidocPlugin extends AutoPlugin {
override def projectSettings = Seq(
Compile / packageDoc / mappings := (ScalaUnidoc / packageDoc / mappings).value,
ThisBuild / apiURL := javadocioUrl.value,
mimaPreviousArtifacts := Set.empty
mimaPreviousArtifacts := Set.empty,
// tell the site plugin about us, without forcing the dependency!
ThisBuild / SettingKey[Option[ModuleID]]("tlSiteApiModule") := Some(projectID.value)
)

}

0 comments on commit 0e013b4

Please sign in to comment.