diff options
author | Felix Mulder <felix.mulder@gmail.com> | 2016-05-05 15:22:29 +0200 |
---|---|---|
committer | Felix Mulder <felix.mulder@gmail.com> | 2016-08-19 15:37:22 +0200 |
commit | 8e39b71b29afd7951745dbaf957eade0e9f51434 (patch) | |
tree | 720ab08f15936a8c0cd4cf5da5f792fcdab3150b /dottydoc/jvm/test/WhitelistedStdLibMain.scala | |
parent | bc594c81c6ce8c696dde2f7668132952e83b383a (diff) | |
download | dotty-8e39b71b29afd7951745dbaf957eade0e9f51434.tar.gz dotty-8e39b71b29afd7951745dbaf957eade0e9f51434.tar.bz2 dotty-8e39b71b29afd7951745dbaf957eade0e9f51434.zip |
Fix repeated traversal of packages when generating docs (5x speedup)
Diffstat (limited to 'dottydoc/jvm/test/WhitelistedStdLibMain.scala')
-rw-r--r-- | dottydoc/jvm/test/WhitelistedStdLibMain.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/dottydoc/jvm/test/WhitelistedStdLibMain.scala b/dottydoc/jvm/test/WhitelistedStdLibMain.scala new file mode 100644 index 000000000..f4a2f9dc6 --- /dev/null +++ b/dottydoc/jvm/test/WhitelistedStdLibMain.scala @@ -0,0 +1,23 @@ +package dotty.tools +package dottydoc + +import scala.io.Source + +object WhitelistedStandardLib extends DottyDoc { + val files: List[String] = { + val whitelist = "../../test/dotc/scala-collections.whitelist" + + Source.fromFile(whitelist, "UTF8") + .getLines() + .map(_.trim) // allow identation + .filter(!_.startsWith("#")) // allow comment lines prefixed by # + .map(_.takeWhile(_ != '#').trim) // allow comments in the end of line + .filter(_.nonEmpty) + .filterNot(_.endsWith("package.scala")) + .map("../." + _) + .toList + } + + override def main(args: Array[String]) = + super.main("-language:Scala2" +: files.toArray) +} |