Fixed unidoc filter and unused property setter
This commit is contained in:
parent
5006c223d9
commit
874169b42b
2 changed files with 15 additions and 12 deletions
|
|
@ -5,7 +5,6 @@ import com.typesafe.tools.mima.plugin.MimaPlugin
|
||||||
import akka.AkkaBuild._
|
import akka.AkkaBuild._
|
||||||
|
|
||||||
initialize := {
|
initialize := {
|
||||||
System.setProperty("akka.mode", "test") // Is there better place for this? (and more importantly, what is it?)
|
|
||||||
// Load system properties from a file to make configuration from Jenkins easier
|
// Load system properties from a file to make configuration from Jenkins easier
|
||||||
loadSystemProperties("project/akka-build.properties")
|
loadSystemProperties("project/akka-build.properties")
|
||||||
initialize.value
|
initialize.value
|
||||||
|
|
@ -40,6 +39,7 @@ lazy val root = Project(
|
||||||
base = file("."),
|
base = file("."),
|
||||||
aggregate = aggregatedProjects
|
aggregate = aggregatedProjects
|
||||||
).settings(rootSettings: _*)
|
).settings(rootSettings: _*)
|
||||||
|
.settings(unidocRootIgnoreProjects := Seq(remoteTests, benchJmh, protobuf, akkaScalaNightly, docs))
|
||||||
|
|
||||||
lazy val akkaScalaNightly = akkaModule("akka-scala-nightly")
|
lazy val akkaScalaNightly = akkaModule("akka-scala-nightly")
|
||||||
// remove dependencies that we have to build ourselves (Scala STM)
|
// remove dependencies that we have to build ourselves (Scala STM)
|
||||||
|
|
|
||||||
|
|
@ -97,6 +97,12 @@ object UnidocRoot extends AutoPlugin {
|
||||||
val genjavadocEnabled = CliOption("akka.genjavadoc.enabled", false)
|
val genjavadocEnabled = CliOption("akka.genjavadoc.enabled", false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
object autoImport {
|
||||||
|
val unidocRootIgnoreProjects = settingKey[Seq[Project]]("Projects to ignore when generating unidoc")
|
||||||
|
val unidocRootProjectFilter = settingKey[ScopeFilter.ProjectFilter]("project filter for generating unidoc")
|
||||||
|
}
|
||||||
|
import autoImport._
|
||||||
|
|
||||||
override def trigger = noTrigger
|
override def trigger = noTrigger
|
||||||
|
|
||||||
val akkaSettings = UnidocRoot.CliOptions.genjavadocEnabled.ifTrue(Seq(
|
val akkaSettings = UnidocRoot.CliOptions.genjavadocEnabled.ifTrue(Seq(
|
||||||
|
|
@ -107,23 +113,20 @@ object UnidocRoot extends AutoPlugin {
|
||||||
sources in(JavaUnidoc, unidoc) ~= (_.filterNot(_.getPath.contains("Access$minusControl$minusAllow$minusOrigin")))
|
sources in(JavaUnidoc, unidoc) ~= (_.filterNot(_.getPath.contains("Access$minusControl$minusAllow$minusOrigin")))
|
||||||
)).getOrElse(Nil)
|
)).getOrElse(Nil)
|
||||||
|
|
||||||
def settings(ignoreAggregates: Seq[Project], ignoreProjects: Seq[Project]) = {
|
def settings() = {
|
||||||
val withoutAggregates = ignoreAggregates.foldLeft(inAnyProject) { _ -- inAggregates(_, transitive = true, includeRoot = true) }
|
|
||||||
val docProjectFilter = ignoreProjects.foldLeft(withoutAggregates) { _ -- inProjects(_) }
|
|
||||||
|
|
||||||
inTask(unidoc)(Seq(
|
inTask(unidoc)(Seq(
|
||||||
unidocProjectFilter in ScalaUnidoc := docProjectFilter,
|
unidocRootProjectFilter := {
|
||||||
unidocProjectFilter in JavaUnidoc := docProjectFilter,
|
val ignoreProjects = unidocRootIgnoreProjects.value
|
||||||
|
ignoreProjects.foldLeft(inAnyProject) { _ -- inProjects(_) }
|
||||||
|
},
|
||||||
|
unidocProjectFilter in ScalaUnidoc := unidocRootProjectFilter.value,
|
||||||
|
unidocProjectFilter in JavaUnidoc := unidocRootProjectFilter.value,
|
||||||
apiMappings in ScalaUnidoc := (apiMappings in (Compile, doc)).value
|
apiMappings in ScalaUnidoc := (apiMappings in (Compile, doc)).value
|
||||||
))
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
override lazy val projectSettings =
|
override lazy val projectSettings =
|
||||||
CliOptions.genjavadocEnabled.ifTrue(scalaJavaUnidocSettings).getOrElse(scalaUnidocSettings) ++
|
CliOptions.genjavadocEnabled.ifTrue(scalaJavaUnidocSettings).getOrElse(scalaUnidocSettings) ++ settings()
|
||||||
// TODO These should be excluded, but I haven't figured out how to exclude them without having the project
|
|
||||||
// reference available anymore (since the Project's are in build.sbt now)
|
|
||||||
// AkkaBuild.remoteTests, AkkaBuild.benchJmh, AkkaBuild.protobuf, AkkaBuild.akkaScalaNightly, AkkaBuild.docs))
|
|
||||||
settings(Seq(), Seq())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue