Skip to content

Commit

Permalink
Adapted doc generation for each scala version, simplified build.sbt
Browse files Browse the repository at this point in the history
  • Loading branch information
ulitol97 committed May 2, 2022
1 parent dee32fc commit 3fafcc8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 19 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/release_sonatype.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- uses: olafurpg/setup-scala@v13
with:
java-version: ${{ matrix.java }}
- run: sbt ++${{ matrix.scala }} ci-release
- run: sbt ci-release
env:
PGP_PASSPHRASE: ${{ secrets.PGP_PASSPHRASE }}
PGP_SECRET: ${{ secrets.PGP_SECRET }}
Expand Down
32 changes: 14 additions & 18 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -202,12 +202,22 @@ lazy val scaladocSettings: Seq[Def.Setting[_]] = Seq(
// Docs footer
"-doc-footer",
"By ulitol97 - <3",
// Skip unnecessary source generated by BuildInfo plugin
"-skip-by-id:buildinfo",
// Other settings: include private members, etc.
"-private",
"-no-link-warnings"
),
) ++ {
// Skip unnecessary source generated by BuildInfo plugin
CrossVersion.partialVersion(scalaVersion.value) match {
// Scala 2
case Some((2, _)) => Seq(
"-skip-packages",
"org:buildinfo"
)
// Scala 3
case Some((3, _)) => Seq("-skip-by-id:buildinfo")
case _ => Seq()
}
},
// Need to generate docs to publish to OSS
Compile / packageDoc / publishArtifact := true
)
Expand All @@ -225,21 +235,7 @@ lazy val unidocSettings: Seq[Def.Setting[_]] = Seq(
// When cleaning, remove unidoc generated docs as well
cleanFiles += (ScalaUnidoc / unidoc / target).value,
// Scalac options, mirroring scaladoc settings
ScalaUnidoc / unidoc / scalacOptions ++= Seq(
"-sourcepath",
(LocalRootProject / baseDirectory).value.getAbsolutePath,
"-doc-source-url",
scmInfo.value.get.browseUrl + "/tree/master€{FILE_PATH}.scala",
"-doc-title",
"Comet API - Docs",
"-doc-version",
version.value,
"-doc-footer",
"By ulitol97 - <3",
"-skip-by-id:buildinfo",
"-private",
"-no-link-warnings"
)
ScalaUnidoc / unidoc / scalacOptions ++= (Compile / doc / scalacOptions).value
)

/* ------------------------------------------------------------------------- */
Expand Down

0 comments on commit 3fafcc8

Please sign in to comment.