Merge pull request #5799 from eatkins/doc-fail-repro

Reproduce scaladoc failures
This commit is contained in:
eugene yokota 2020-09-07 04:55:42 -04:00 committed by GitHub
commit f0f14f9c49
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 7 deletions

View File

@ -1,5 +1,19 @@
import complete.{ Parser, Parsers }
import Parser._
import Parsers._
lazy val root = (project in file("."))
.settings(
crossPaths := false,
Compile / doc / scalacOptions += "-Xfatal-warnings"
crossScalaVersions := Seq("2.12.12", "2.13.3"),
scalaVersion := "2.12.12",
Compile / doc / scalacOptions += "-Xfatal-warnings",
commands += Command.command("excludeB") { s =>
val impl = """val src = (sources in Compile).value; src.filterNot(_.getName.contains("B"))"""
s"set sources in (Compile, doc) := { $impl }" :: s
},
commands += Command.arb(_ => ("setDocExtension": Parser[String]) ~> " " ~> matched(any.*)) { (s, filter: String) =>
val impl = s"""val src = (sources in Compile).value; src.filter(_.getName.endsWith("$filter"))"""
s"set sources in (Compile, doc) := { $impl }" :: s
},
)

View File

@ -0,0 +1,6 @@
object B {
/**
* @param i An argument
*/
def x(i: Int) = 3
}

View File

@ -1,35 +1,47 @@
> debug
-> doc
# -> doc
> set sources in (Compile, doc) := { val src = (sources in Compile).value; src.filterNot(_.getName contains "B") }
> excludeB
# hybrid project, only scaladoc run
> doc
$ exists target/api/index.js
$ exists target/api/A$.html
$ absent target/api/scala
$ absent target/api/java
> set sources in (Compile, doc) := { val src = (sources in (Compile, doc)).value; src.filterNot(_.getName endsWith ".java") }
> setDocExtension scala
# The original B.scala fails scaladoc
$ copy-file changes/B.scala B.scala
# compile task is superfluous. Since doc task preceded by compile task has been problematic due to scala
# compiler's way of handling empty classpath. We have it here to test that our workaround works.
> clean ; compile ; doc
# pure scala project, only scaladoc at top level
$ exists target/api/index.js
$ exists target/api/A$.html
$ exists target/api/B$.html
$ absent target/api/package-list
$ absent target/api/scala
$ absent target/api/java
> set sources in (Compile, doc) := { val src = (sources in Compile).value; src.filter(_.getName endsWith ".java") }
> setDocExtension java
> clean ; doc
# pure java project, only javadoc at top level
$ exists target/api/index.html
$ exists target/api/pkg/J.html
$ absent target/api/index.js
> setDocExtension scala
> ++2.13.3
> clean
$ absent target/api/A$.html
> doc
$ exists target/api/A$.html
$ exists target/api/B$.html
# pending
# $ absent target/api/scala
# $ absent target/api/java