only unidoc for Scala 2.12, #25985

* otherwise the docs built with 2.11 will be published for release,
  since the 2.11 build is last
This commit is contained in:
Patrik Nordwall 2018-12-05 18:53:37 +01:00
parent 7afd847758
commit 4742a23e9e
2 changed files with 11 additions and 4 deletions

View file

@ -53,7 +53,12 @@ lazy val root = Project(
base = file(".")
).aggregate(aggregatedProjects: _*)
.settings(rootSettings: _*)
.settings(unidocRootIgnoreProjects := Seq(remoteTests, benchJmh, protobuf, akkaScalaNightly, docs))
.settings(unidocRootIgnoreProjects :=
(CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, n)) if n == 11 ⇒ aggregatedProjects // ignore all, don't unidoc when scalaVersion is 2.11
case _ ⇒ Seq(remoteTests, benchJmh, protobuf, akkaScalaNightly, docs)
})
)
.settings(
unmanagedSources in(Compile, headerCreate) := (baseDirectory.value / "project").**("*.scala").get
)

View file

@ -13,6 +13,8 @@ import sbt.Keys._
import sbt.File
import scala.annotation.tailrec
import sbt.ScopeFilter.ProjectFilter
object Scaladoc extends AutoPlugin {
object CliOptions {
@ -100,7 +102,7 @@ object UnidocRoot extends AutoPlugin {
}
object autoImport {
val unidocRootIgnoreProjects = settingKey[Seq[Project]]("Projects to ignore when generating unidoc")
val unidocRootIgnoreProjects = settingKey[Seq[ProjectReference]]("Projects to ignore when generating unidoc")
}
import autoImport._
@ -113,7 +115,7 @@ object UnidocRoot extends AutoPlugin {
Seq(javacOptions in (JavaUnidoc, unidoc) := Seq("-Xdoclint:none"))).getOrElse(Nil)
override lazy val projectSettings = {
def unidocRootProjectFilter(ignoreProjects: Seq[Project]) =
def unidocRootProjectFilter(ignoreProjects: Seq[ProjectReference]): ProjectFilter =
ignoreProjects.foldLeft(inAnyProject) { _ -- inProjects(_) }
inTask(unidoc)(Seq(