aboutsummaryrefslogtreecommitdiff
path: root/doc-tool/test
diff options
context:
space:
mode:
authorFelix Mulder <felix.mulder@gmail.com>2017-01-13 13:38:44 +0100
committerFelix Mulder <felix.mulder@gmail.com>2017-01-31 14:31:08 +0100
commiteeeada2083dead6ef15c2c45e4158fa677b8ec02 (patch)
tree0e5e634c3a5e5c69f17e1d4953a444ca766fbe09 /doc-tool/test
parent2c08c956d39d9a06b3c5aa7eddc3b8c903f807df (diff)
downloaddotty-eeeada2083dead6ef15c2c45e4158fa677b8ec02.tar.gz
dotty-eeeada2083dead6ef15c2c45e4158fa677b8ec02.tar.bz2
dotty-eeeada2083dead6ef15c2c45e4158fa677b8ec02.zip
Fix dotty docs gen, scroll
Diffstat (limited to 'doc-tool/test')
-rw-r--r--doc-tool/test/GenDocs.scala33
1 files changed, 8 insertions, 25 deletions
diff --git a/doc-tool/test/GenDocs.scala b/doc-tool/test/GenDocs.scala
index 358e52fdf..c60e8f1e0 100644
--- a/doc-tool/test/GenDocs.scala
+++ b/doc-tool/test/GenDocs.scala
@@ -12,24 +12,15 @@ object Files {
trait LocalResources extends api.scala.Dottydoc {
import Files._
- val template = new JFile(
- sys.env.get("DOC_TEMPLATE").getOrElse("../../dottydoc-client/resources/template.html")
- )
- val resources = new JFile(
- sys.env.get("DOC_RESOURCES").getOrElse("../../dottydoc-client/resources/")
- ).listFiles
-
def getFiles(file: JFile): Array[JFile] =
if (file.isDirectory) file.listFiles.flatMap(getFiles)
else if (file.getAbsolutePath.endsWith(".scala")) Array(file)
else Array()
- assert(template.exists, "please specify a template.html file using DOC_TEMPLATE env var")
- assert(resources.forall(_.exists), "please specify a resource dir using DOC_RESOURCES env var")
-
- def index(files: Array[String]) = createIndex(
- "-language:Scala2" +: "-classpath" +: "../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar:../interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar" +: files
- )
+ def withClasspath(files: Array[String]) =
+ "-language:Scala2" +:
+ "-classpath" +: "../library/target/scala-2.11/dotty-library_2.11-0.1-SNAPSHOT.jar:../interfaces/target/dotty-interfaces-0.1-SNAPSHOT.jar" +:
+ files
}
object GenCollections extends LocalResources {
@@ -37,12 +28,8 @@ object GenCollections extends LocalResources {
val collections = TestWhitelistedCollections.files
- override def main(args: Array[String]): Unit = buildDocs(
- "../local/docs",
- template.getUrl,
- resources.map(_.getUrl).toList,
- index(collections.toArray)
- )
+ override def main(args: Array[String]): Unit =
+ super.main(Array("-siteroot", "../docs") ++ withClasspath(collections.toArray))
}
object GenDottyDocs extends LocalResources {
@@ -50,10 +37,6 @@ object GenDottyDocs extends LocalResources {
val dottyFiles = new JFile("../compiler/src/dotty").listFiles.flatMap(getFiles).map(_.getAbsolutePath)
- override def main(args: Array[String]): Unit = buildDocs(
- "../local/docs",
- template.getUrl,
- resources.map(_.getUrl).toList,
- index(dottyFiles)
- )
+ override def main(args: Array[String]): Unit =
+ super.main(Array("-siteroot", "../docs") ++ withClasspath(dottyFiles))
}