diff --git a/akka-docs-dev/build.sbt b/akka-docs-dev/build.sbt new file mode 100644 index 0000000000..fb17672f14 --- /dev/null +++ b/akka-docs-dev/build.sbt @@ -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 \ No newline at end of file diff --git a/akka-http-marshallers-scala/akka-http-xml/src/main/scala/akka/http/scaladsl/marshallers/xml/ScalaXmlSupport.scala b/akka-http-marshallers-scala/akka-http-xml/src/main/scala/akka/http/scaladsl/marshallers/xml/ScalaXmlSupport.scala index bf317c3818..3720f14545 100644 --- a/akka-http-marshallers-scala/akka-http-xml/src/main/scala/akka/http/scaladsl/marshallers/xml/ScalaXmlSupport.scala +++ b/akka-http-marshallers-scala/akka-http-xml/src/main/scala/akka/http/scaladsl/marshallers/xml/ScalaXmlSupport.scala @@ -33,7 +33,7 @@ trait ScalaXmlSupport { /** * 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() } diff --git a/project/AkkaBuild.scala b/project/AkkaBuild.scala index 981b5b57cb..e2cdaf5810 100644 --- a/project/AkkaBuild.scala +++ b/project/AkkaBuild.scala @@ -16,6 +16,7 @@ import com.typesafe.sbt.SbtMultiJvm.MultiJvmKeys.MultiJvm import sbt.Keys._ import sbt._ import sbtunidoc.Plugin.ScalaUnidoc +import sbtunidoc.Plugin.JavaUnidoc import sbtunidoc.Plugin.UnidocKeys._ object AkkaBuild extends Build { @@ -40,6 +41,7 @@ object AkkaBuild extends Build { base = file("."), settings = parentSettings ++ Release.settings ++ SphinxDoc.akkaSettings ++ Dist.settings ++ s3Settings ++ + UnidocRoot.akkaSettings ++ Protobuf.settings ++ Seq( parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", parallelExecutionByDefault.toString).toBoolean, 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, // streamAndHttp, // does not seem to work 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, // streamAndHttp, // does not seem to work stream, streamTestkit, streamTests, streamTestsTck, - httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests + httpCore, http, httpSprayJson, httpXml, httpJackson, httpTests, httpTestkit, + docsDev // TODO merge with `docs` ) ).disablePlugins(ValidatePullRequest) @@ -216,14 +220,11 @@ object AkkaBuild extends Build { SphinxDoc.akkaSettings ++ Dist.settings ++ Protobuf.settings ++ Seq( - unidocProjectFilter in (ScalaUnidoc, unidoc) := inAnyProject, Dist.distExclude := Seq(), // testMailbox in GlobalScope := System.getProperty("akka.testMailbox", "false").toBoolean, parallelExecution in GlobalScope := System.getProperty("akka.parallelExecution", "false").toBoolean, 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"), // packageDoc in Compile <<= packageDoc in JavaDoc, @@ -256,13 +257,6 @@ object AkkaBuild extends Build { base = file("akka-http-core"), dependencies = Seq(stream, parsing, streamTestkit % "test->test"), 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( @@ -415,6 +409,13 @@ object AkkaBuild extends Build { 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( id = "akka-contrib", base = file("akka-contrib"), @@ -541,7 +542,8 @@ object AkkaBuild extends Build { 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( // compile options 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 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 doc ++= Seq("-encoding", "UTF-8", "-source", "1.8"), + javacOptions in doc ++= Seq(), incOptions := incOptions.value.withNameHashing(true), crossVersion := CrossVersion.binary, @@ -596,7 +598,14 @@ object AkkaBuild extends Build { testOptions += Tests.Argument(TestFrameworks.JUnit, "-v", "-a") ) ++ 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 { if (enableMiMa) { diff --git a/project/Doc.scala b/project/Doc.scala index 6a1de8219d..96b43574aa 100644 --- a/project/Doc.scala +++ b/project/Doc.scala @@ -99,6 +99,14 @@ object UnidocRoot extends AutoPlugin { 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]) = { val withoutAggregates = ignoreAggregates.foldLeft(inAnyProject) { _ -- inAggregates(_, transitive = true, includeRoot = true) } val docProjectFilter = ignoreProjects.foldLeft(withoutAggregates) { _ -- inProjects(_) }