mirror of https://github.com/sbt/sbt.git
Add scripted verification that doc works
In 1.4.0-RC2, doc did not actually generate html files for the project clases. This was fixed in zinc and this commit updates the actions/doc scripted test to verify that doc actually generates output for the project classes.
This commit is contained in:
parent
d1e7b2c35c
commit
dc3bccc57f
|
|
@ -1,5 +1,19 @@
|
||||||
|
import complete.{ Parser, Parsers }
|
||||||
|
import Parser._
|
||||||
|
import Parsers._
|
||||||
|
|
||||||
lazy val root = (project in file("."))
|
lazy val root = (project in file("."))
|
||||||
.settings(
|
.settings(
|
||||||
crossPaths := false,
|
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
|
||||||
|
},
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
object B {
|
||||||
|
/**
|
||||||
|
* @param i An argument
|
||||||
|
*/
|
||||||
|
def x(i: Int) = 3
|
||||||
|
}
|
||||||
|
|
@ -1,35 +1,47 @@
|
||||||
> debug
|
-> doc
|
||||||
|
|
||||||
# -> doc
|
> excludeB
|
||||||
|
|
||||||
> set sources in (Compile, doc) := { val src = (sources in Compile).value; src.filterNot(_.getName contains "B") }
|
|
||||||
|
|
||||||
# hybrid project, only scaladoc run
|
# hybrid project, only scaladoc run
|
||||||
> doc
|
> doc
|
||||||
$ exists target/api/index.js
|
$ exists target/api/index.js
|
||||||
|
$ exists target/api/A$.html
|
||||||
$ absent target/api/scala
|
$ absent target/api/scala
|
||||||
$ absent target/api/java
|
$ 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
|
# 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.
|
# compiler's way of handling empty classpath. We have it here to test that our workaround works.
|
||||||
> clean ; compile ; doc
|
> clean ; compile ; doc
|
||||||
|
|
||||||
# pure scala project, only scaladoc at top level
|
# pure scala project, only scaladoc at top level
|
||||||
$ exists target/api/index.js
|
$ exists target/api/index.js
|
||||||
|
$ exists target/api/A$.html
|
||||||
|
$ exists target/api/B$.html
|
||||||
$ absent target/api/package-list
|
$ absent target/api/package-list
|
||||||
$ absent target/api/scala
|
$ absent target/api/scala
|
||||||
$ absent target/api/java
|
$ absent target/api/java
|
||||||
|
|
||||||
> set sources in (Compile, doc) := { val src = (sources in Compile).value; src.filter(_.getName endsWith ".java") }
|
> setDocExtension java
|
||||||
|
|
||||||
> clean ; doc
|
> clean ; doc
|
||||||
|
|
||||||
# pure java project, only javadoc at top level
|
# pure java project, only javadoc at top level
|
||||||
$ exists target/api/index.html
|
$ exists target/api/index.html
|
||||||
|
$ exists target/api/pkg/J.html
|
||||||
$ absent target/api/index.js
|
$ 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
|
# pending
|
||||||
# $ absent target/api/scala
|
# $ absent target/api/scala
|
||||||
# $ absent target/api/java
|
# $ absent target/api/java
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue