From eeeada2083dead6ef15c2c45e4158fa677b8ec02 Mon Sep 17 00:00:00 2001 From: Felix Mulder Date: Fri, 13 Jan 2017 13:38:44 +0100 Subject: Fix dotty docs gen, scroll --- doc-tool/test/GenDocs.scala | 33 ++++++++------------------------- 1 file changed, 8 insertions(+), 25 deletions(-) (limited to 'doc-tool/test') 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)) } -- cgit v1.2.3