We want to exclude a particular package named "internal" from scaladoc and javadoc for all projects. We have UnidocSite plugin as follows:
object UnidocSite extends AutoPlugin {
import sbtunidoc.{BaseUnidocPlugin, JavaUnidocPlugin, ScalaUnidocPlugin}
import JavaUnidocPlugin.autoImport._
import ScalaUnidocPlugin.autoImport._
import BaseUnidocPlugin.autoImport.unidoc
import com.typesafe.sbt.site.SitePlugin.autoImport._
override def requires: Plugins = ScalaUnidocPlugin && JavaUnidocPlugin
def excludeJavadoc: Set[String] = Set("internal", "scaladsl", "csw_protobuf")
def excludeScaladoc: String = Seq("internal", "csw_protobuf", "akka").mkString(":")
override def projectSettings: Seq[Setting[_]] = Seq(
siteSubdirName in ScalaUnidoc := "/api/scala",
addMappingsToSiteDir(mappings in (ScalaUnidoc, packageDoc), siteSubdirName in ScalaUnidoc),
siteSubdirName in JavaUnidoc := "/api/java",
filterNotSources(sources in (JavaUnidoc, unidoc), excludeJavadoc),
addMappingsToSiteDir(mappings in (JavaUnidoc, packageDoc), siteSubdirName in JavaUnidoc),
scalacOptions in (ScalaUnidoc, unidoc) ++= Seq("-skip-packages", excludeScaladoc),
autoAPIMappings := true
)
def filterNotSources(filesKey: TaskKey[Seq[File]], subPaths: Set[String]): Setting[Task[Seq[File]]] = {
filesKey := filesKey.value.filterNot(file => subPaths.exists(file.getAbsolutePath.contains))
}
}
But somehow "internal" package gets excluded only from javadoc and not from scaladoc.
Is there something we are missing ?
We want to exclude a particular package named "internal" from scaladoc and javadoc for all projects. We have UnidocSite plugin as follows:
But somehow "internal" package gets excluded only from javadoc and not from scaladoc.
Is there something we are missing ?