=pro fix unidoc/javadoc settings
This commit is contained in:
parent
7efc6e7a27
commit
098ef546d7
4 changed files with 64 additions and 17 deletions
30
akka-docs-dev/build.sbt
Normal file
30
akka-docs-dev/build.sbt
Normal file
|
|
@ -0,0 +1,30 @@
|
||||||
|
import akka.{ AkkaBuild, Dependencies, Formatting, SphinxDoc }
|
||||||
|
import akka.ValidatePullRequest._
|
||||||
|
import com.typesafe.sbt.SbtScalariform.ScalariformKeys
|
||||||
|
import com.typesafe.sbt.SbtSite.site
|
||||||
|
import com.typesafe.sbt.site.SphinxSupport._
|
||||||
|
import com.typesafe.tools.mima.plugin.MimaKeys
|
||||||
|
|
||||||
|
enablePlugins(ScaladocNoVerificationOfDiagrams)
|
||||||
|
|
||||||
|
AkkaBuild.defaultSettings
|
||||||
|
|
||||||
|
Formatting.docFormatSettings
|
||||||
|
|
||||||
|
site.settings
|
||||||
|
|
||||||
|
site.sphinxSupport()
|
||||||
|
|
||||||
|
site.publishSite
|
||||||
|
|
||||||
|
SphinxDoc.sphinxPreprocessing
|
||||||
|
|
||||||
|
SphinxDoc.docsSettings
|
||||||
|
|
||||||
|
Dependencies.docs
|
||||||
|
|
||||||
|
unmanagedSourceDirectories in ScalariformKeys.format in Test <<= unmanagedSourceDirectories in Test
|
||||||
|
|
||||||
|
additionalTasks in ValidatePR += generate in Sphinx
|
||||||
|
|
||||||
|
AkkaBuild.dontPublishSettings
|
||||||
|
|
@ -33,7 +33,7 @@ trait ScalaXmlSupport {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Provides a SAXParser for the NodeSeqUnmarshaller to use. Override to provide a custom SAXParser implementation.
|
* Provides a SAXParser for the NodeSeqUnmarshaller to use. Override to provide a custom SAXParser implementation.
|
||||||
* Will be called once for for every request to be unmarshalled. The default implementation calls [[ScalaXmlSupport.createSaferSAXParser]].
|
* Will be called once for for every request to be unmarshalled. The default implementation calls `ScalaXmlSupport.createSaferSAXParser`.
|
||||||
*/
|
*/
|
||||||
protected def createSAXParser(): SAXParser = ScalaXmlSupport.createSaferSAXParser()
|
protected def createSAXParser(): SAXParser = ScalaXmlSupport.createSaferSAXParser()
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,7 @@ import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm
|
||||||
import sbt.Keys._
|
import sbt.Keys._
|
||||||
import sbt._
|
import sbt._
|
||||||
import sbtunidoc.Plugin.ScalaUnidoc
|
import sbtunidoc.Plugin.ScalaUnidoc
|
||||||
|
import sbtunidoc.Plugin.JavaUnidoc
|
||||||
import sbtunidoc.Plugin.UnidocKeys._
|
import sbtunidoc.Plugin.UnidocKeys._
|
||||||
|
|
||||||
object AkkaBuild extends Build {
|
object AkkaBuild extends Build {
|
||||||
|
|
@ -40,6 +41,7 @@ object AkkaBuild extends Build {
|
||||||
base = file("."),
|
base = file("."),
|
||||||
settings = parentSettings ++ Release.settings ++
|
settings = parentSettings ++ Release.settings ++
|
||||||
SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++
|
SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++
|
||||||
|
UnidocRoot.akkaSettings ++
|
||||||
Protobuf.settings ++ Seq(
|
Protobuf.settings ++ Seq(
|
||||||
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean,
|
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean,
|
||||||
Dist.distExclude := Seq(actorTests.id, docs.id, samples.id, osgi.id),
|
Dist.distExclude := Seq(actorTests.id, docs.id, samples.id, osgi.id),
|
||||||
|
|
@ -65,7 +67,8 @@ object AkkaBuild extends Build {
|
||||||
slf4j, agent, persistence, persistenceQuery, persistenceTck, kernel, osgi, docs, contrib, samples, multiNodeTestkit, benchJmh, typed, protobuf,
|
slf4j, agent, persistence, persistenceQuery, persistenceTck, kernel, osgi, docs, contrib, samples, multiNodeTestkit, benchJmh, typed, protobuf,
|
||||||
// streamAndHttp, // does not seem to work
|
// streamAndHttp, // does not seem to work
|
||||||
stream, streamTestkit, streamTests, streamTestsTck,
|
stream, streamTestkit, streamTests, streamTestsTck,
|
||||||
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests
|
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests, httpTestkit,
|
||||||
|
docsDev // TODO merge with `docs`
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
@ -79,7 +82,8 @@ object AkkaBuild extends Build {
|
||||||
slf4j, persistence, persistenceQuery, persistenceTck, kernel, osgi, contrib, multiNodeTestkit, benchJmh, typed, protobuf,
|
slf4j, persistence, persistenceQuery, persistenceTck, kernel, osgi, contrib, multiNodeTestkit, benchJmh, typed, protobuf,
|
||||||
// streamAndHttp, // does not seem to work
|
// streamAndHttp, // does not seem to work
|
||||||
stream, streamTestkit, streamTests, streamTestsTck,
|
stream, streamTestkit, streamTests, streamTestsTck,
|
||||||
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests
|
httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests, httpTestkit,
|
||||||
|
docsDev // TODO merge with `docs`
|
||||||
)
|
)
|
||||||
).disablePlugins(ValidatePullRequest)
|
).disablePlugins(ValidatePullRequest)
|
||||||
|
|
||||||
|
|
@ -216,14 +220,11 @@ object AkkaBuild extends Build {
|
||||||
SphinxDoc.akkaSettings ++
|
SphinxDoc.akkaSettings ++
|
||||||
Dist.settings ++
|
Dist.settings ++
|
||||||
Protobuf.settings ++ Seq(
|
Protobuf.settings ++ Seq(
|
||||||
unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject,
|
|
||||||
Dist.distExclude := Seq(),
|
Dist.distExclude := Seq(),
|
||||||
// testMailbox in GlobalScope := System.getProperty("akka.testMailbox", "false").toBoolean,
|
// testMailbox in GlobalScope := System.getProperty("akka.testMailbox", "false").toBoolean,
|
||||||
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
|
parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean,
|
||||||
Publish.defaultPublishTo in ThisBuild <<= crossTarget / "repository"
|
Publish.defaultPublishTo in ThisBuild <<= crossTarget / "repository"
|
||||||
// sources in JavaDoc <<= junidocSources,
|
// javacOptions in JavaDoc ++= Seq("-Xdoclint:none"), TODO likely still needed
|
||||||
|
|
||||||
// javacOptions in JavaDoc ++= Seq("-Xdoclint:none"), TODO likely still needed
|
|
||||||
// artifactName in packageDoc in JavaDoc := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"),
|
// artifactName in packageDoc in JavaDoc := ((sv, mod, art) => "" + mod.name + "_" + sv.binary + "-" + mod.revision + "-javadoc.jar"),
|
||||||
// packageDoc in Compile <<= packageDoc in JavaDoc,
|
// packageDoc in Compile <<= packageDoc in JavaDoc,
|
||||||
|
|
||||||
|
|
@ -256,13 +257,6 @@ object AkkaBuild extends Build {
|
||||||
base = file("akka-http-core"),
|
base = file("akka-http-core"),
|
||||||
dependencies = Seq(stream, parsing, streamTestkit % "test->test"),
|
dependencies = Seq(stream, parsing, streamTestkit % "test->test"),
|
||||||
settings = defaultSettings
|
settings = defaultSettings
|
||||||
// ++ (if (GenJavaDocEnabled) Seq(
|
|
||||||
// // genjavadoc needs to generate synthetic methods since the java code uses them
|
|
||||||
// scalacOptions += "-P:genjavadoc:suppressSynthetic=false",
|
|
||||||
// // FIXME: see #18056
|
|
||||||
// sources in JavaDoc ~= (_.filterNot(_.getPath.contains("Access$minusControl$minusAllow$minusOrigin")))
|
|
||||||
// ) else Nil
|
|
||||||
// )
|
|
||||||
)
|
)
|
||||||
|
|
||||||
lazy val http = Project(
|
lazy val http = Project(
|
||||||
|
|
@ -415,6 +409,13 @@ object AkkaBuild extends Build {
|
||||||
typed % "compile;test->test", distributedData)
|
typed % "compile;test->test", distributedData)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
lazy val docsDev = Project(
|
||||||
|
id = "akka-docs-dev",
|
||||||
|
base = file("akka-docs-dev"),
|
||||||
|
dependencies = Seq(streamTestkit % "test->test", stream, httpCore, http, httpTestkit, httpSprayJson, httpXml),
|
||||||
|
settings = defaultSettings
|
||||||
|
)
|
||||||
|
|
||||||
lazy val contrib = Project(
|
lazy val contrib = Project(
|
||||||
id = "akka-contrib",
|
id = "akka-contrib",
|
||||||
base = file("akka-contrib"),
|
base = file("akka-contrib"),
|
||||||
|
|
@ -541,7 +542,8 @@ object AkkaBuild extends Build {
|
||||||
|
|
||||||
private def allWarnings: Boolean = System.getProperty("akka.allwarnings", "false").toBoolean
|
private def allWarnings: Boolean = System.getProperty("akka.allwarnings", "false").toBoolean
|
||||||
|
|
||||||
lazy val defaultSettings = resolverSettings ++ TestExtras.Filter.settings ++
|
lazy val defaultSettings = resolverSettings ++
|
||||||
|
TestExtras.Filter.settings ++
|
||||||
Protobuf.settings ++ Seq(
|
Protobuf.settings ++ Seq(
|
||||||
// compile options
|
// compile options
|
||||||
scalacOptions in Compile ++= Seq("-encoding", "UTF-8", "-target:jvm-1.8", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint"),
|
scalacOptions in Compile ++= Seq("-encoding", "UTF-8", "-target:jvm-1.8", "-feature", "-unchecked", "-Xlog-reflective-calls", "-Xlint"),
|
||||||
|
|
@ -551,7 +553,7 @@ object AkkaBuild extends Build {
|
||||||
// -XDignore.symbol.file suppresses sun.misc.Unsafe warnings
|
// -XDignore.symbol.file suppresses sun.misc.Unsafe warnings
|
||||||
javacOptions in compile ++= Seq("-encoding", "UTF-8", "-source", "1.8", "-target", "1.8", "-Xlint:unchecked", "-XDignore.symbol.file"),
|
javacOptions in compile ++= Seq("-encoding", "UTF-8", "-source", "1.8", "-target", "1.8", "-Xlint:unchecked", "-XDignore.symbol.file"),
|
||||||
javacOptions in compile ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
|
javacOptions in compile ++= (if (allWarnings) Seq("-Xlint:deprecation") else Nil),
|
||||||
javacOptions in doc ++= Seq("-encoding", "UTF-8", "-source", "1.8"),
|
javacOptions in doc ++= Seq(),
|
||||||
incOptions := incOptions.value.withNameHashing(true),
|
incOptions := incOptions.value.withNameHashing(true),
|
||||||
|
|
||||||
crossVersion := CrossVersion.binary,
|
crossVersion := CrossVersion.binary,
|
||||||
|
|
@ -596,7 +598,14 @@ object AkkaBuild extends Build {
|
||||||
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a")
|
testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a")
|
||||||
) ++
|
) ++
|
||||||
mavenLocalResolverSettings ++
|
mavenLocalResolverSettings ++
|
||||||
JUnitFileReporting.settings
|
JUnitFileReporting.settings ++
|
||||||
|
docLintingSettings
|
||||||
|
|
||||||
|
lazy val docLintingSettings = Seq(
|
||||||
|
javacOptions in compile ++= Seq("-Xdoclint:none"),
|
||||||
|
javacOptions in test ++= Seq("-Xdoclint:none"),
|
||||||
|
javacOptions in doc ++= Seq("-Xdoclint:none")
|
||||||
|
)
|
||||||
|
|
||||||
def akkaPreviousArtifacts(id: String): Def.Initialize[Set[sbt.ModuleID]] = Def.setting {
|
def akkaPreviousArtifacts(id: String): Def.Initialize[Set[sbt.ModuleID]] = Def.setting {
|
||||||
if (enableMiMa) {
|
if (enableMiMa) {
|
||||||
|
|
|
||||||
|
|
@ -99,6 +99,14 @@ object UnidocRoot extends AutoPlugin {
|
||||||
|
|
||||||
override def trigger = noTrigger
|
override def trigger = noTrigger
|
||||||
|
|
||||||
|
val akkaSettings = UnidocRoot.CliOptions.genjavadocEnabled.ifTrue(Seq(
|
||||||
|
javacOptions in (JavaUnidoc, unidoc) ++= Seq("-Xdoclint:none"), // TODO likely still needed
|
||||||
|
// genjavadoc needs to generate synthetic methods since the java code uses them
|
||||||
|
scalacOptions += "-P:genjavadoc:suppressSynthetic=false",
|
||||||
|
// FIXME: see #18056
|
||||||
|
sources in(JavaUnidoc, unidoc) ~= (_.filterNot(_.getPath.contains("Access$minusControl$minusAllow$minusOrigin")))
|
||||||
|
)).getOrElse(Nil)
|
||||||
|
|
||||||
def settings(ignoreAggregates: Seq[Project], ignoreProjects: Seq[Project]) = {
|
def settings(ignoreAggregates: Seq[Project], ignoreProjects: Seq[Project]) = {
|
||||||
val withoutAggregates = ignoreAggregates.foldLeft(inAnyProject) { _ -- inAggregates(_, transitive = true, includeRoot = true) }
|
val withoutAggregates = ignoreAggregates.foldLeft(inAnyProject) { _ -- inAggregates(_, transitive = true, includeRoot = true) }
|
||||||
val docProjectFilter = ignoreProjects.foldLeft(withoutAggregates) { _ -- inProjects(_) }
|
val docProjectFilter = ignoreProjects.foldLeft(withoutAggregates) { _ -- inProjects(_) }
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue