diff options
author | Li Haoyi <haoyi@dropbox.com> | 2014-11-09 10:08:47 -0800 |
---|---|---|
committer | Li Haoyi <haoyi@dropbox.com> | 2014-11-09 10:08:47 -0800 |
commit | 978a138c02c07822ef71f31f71e552a9659a0a53 (patch) | |
tree | 9771e4d4620af7e6f5ff54cb4c711e04cffb4e30 /book/src/main/scala/book/Book.scala | |
parent | 795c0eb5de003b22c3874762557ae2b34ae64de0 (diff) | |
download | hands-on-scala-js-978a138c02c07822ef71f31f71e552a9659a0a53.tar.gz hands-on-scala-js-978a138c02c07822ef71f31f71e552a9659a0a53.tar.bz2 hands-on-scala-js-978a138c02c07822ef71f31f71e552a9659a0a53.zip |
wip
Diffstat (limited to 'book/src/main/scala/book/Book.scala')
-rw-r--r-- | book/src/main/scala/book/Book.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/book/src/main/scala/book/Book.scala b/book/src/main/scala/book/Book.scala index ad52177..785e6ab 100644 --- a/book/src/main/scala/book/Book.scala +++ b/book/src/main/scala/book/Book.scala @@ -135,4 +135,28 @@ object Book { pre(code(cls:=lang + " highlight-me", blob)) } } + import java.io.File + def recursiveListFiles(f: File): Array[File] = { + val these = f.listFiles + these ++ these.filter(_.isDirectory).flatMap(recursiveListFiles) + } + lazy val javaAPIs = { + val roots = Seq( + "output/scala-js/javalanglib/src/main/scala", + "output/scala-js/javalib/src/main/scala" + ) + for{ + root <- roots + file <- recursiveListFiles(new File(root)) + if file != null + if file.isFile + } yield{ + val path = file.getPath + .drop(root.length + 1) + .dropRight(".scala".length) + val filename = path.replace('/', '.') + val docpath = s"https://docs.oracle.com/javase/7/docs/api/$path.html" + filename -> docpath + } + } } |