diff options
author | michelou <michelou@epfl.ch> | 2003-11-17 20:46:47 +0000 |
---|---|---|
committer | michelou <michelou@epfl.ch> | 2003-11-17 20:46:47 +0000 |
commit | bcd8a97b88d798245d3d4c621e0b9fbd222b31ff (patch) | |
tree | 5d75fa41515a0b38c20cc17bd126322bcf4f9b6e /sources | |
parent | 64913ef74927b3eb231d591e0484e61898204cc7 (diff) | |
download | scala-bcd8a97b88d798245d3d4c621e0b9fbd222b31ff.tar.gz scala-bcd8a97b88d798245d3d4c621e0b9fbd222b31ff.tar.bz2 scala-bcd8a97b88d798245d3d4c621e0b9fbd222b31ff.zip |
- started migration of scaladoc from Java to Scala
Diffstat (limited to 'sources')
-rw-r--r-- | sources/bin/.scala_wrapper.tmpl | 22 | ||||
-rw-r--r-- | sources/scala/tools/scaladoc/Main.scala | 41 |
2 files changed, 62 insertions, 1 deletions
diff --git a/sources/bin/.scala_wrapper.tmpl b/sources/bin/.scala_wrapper.tmpl index a0d974bdc6..0b60f966d0 100644 --- a/sources/bin/.scala_wrapper.tmpl +++ b/sources/bin/.scala_wrapper.tmpl @@ -322,6 +322,26 @@ exec_dtd2scala() { "$@"; } +# Starts a program using scaladoc. The given arguments are passed to +# exec_java. They must, at least, contain the name of the main class. +exec_scaladoc() { + [ $# -gt 0 ] || abort "internal error"; + + # compute Java classpath + append_path JAVA_CLASSPATH RUNTIME_CLASSES; + append_path JAVA_CLASSPATH TOOLS_CLASSES; + + # compute Scala classpath and bootclasspath + compute_scala_classpath; + compute_scala_bootclasspath; + + # invoke Java + exec_java \ + -Dscala.class.path=`get_os_pathlist "$SCALA_CLASSPATH"` \ + -Dscala.boot.class.path=`get_os_pathlist "$SCALA_BOOTCLASSPATH"` \ + "$@"; +} + # Starts a program using scalap. The given arguments are passed to # exec_java. They must, at least, contain the name of the main class. exec_scalap() { @@ -520,7 +540,7 @@ case "$SCRIPT" in scala ) scala "$@";; scala-info ) scala_info "$@";; scalac* ) exec_compile scalac.Main "$@";; - scaladoc* ) exec_compile scala.tools.scaladoc.Main "$@";; + scaladoc* ) exec_scaladoc scala.tools.scaladoc.Main "$@";; scalarun* ) exec_interpret scala.tools.scalai.Main "$@";; scalaint* ) exec_interpret scala.tools.scalai.Main -interactive "$@";; dtd2scala* ) exec_dtd2scala scala.tools.dtd2scala.Main "$@";; diff --git a/sources/scala/tools/scaladoc/Main.scala b/sources/scala/tools/scaladoc/Main.scala new file mode 100644 index 0000000000..961a4ae4c1 --- /dev/null +++ b/sources/scala/tools/scaladoc/Main.scala @@ -0,0 +1,41 @@ +/* ____ ____ ____ ____ ______ *\ +** / __// __ \/ __// __ \/ ____/ SOcos COmpiles Scala ** +** __\_ \/ /_/ / /__/ /_/ /\_ \ (c) 2002, LAMP/EPFL ** +** /_____/\____/\___/\____/____/ ** +\* */ + +// $Id$ + +package scala.tools.scaladoc; + +import scalac.Global; +import scalac.util.Reporter; + +/** + * The main class for scaladoc, an HTML documentation generator + * for the programming language Scala. + * + * @author Vincent Cremet, Stephane Micheloud + * @version 1.0 + */ +object Main { + + val PRODUCT: String = + System.getProperty("scala.product", "scaladoc"); + val VERSION: String = + System.getProperty("scala.version", "1.0"); + + def main(args: Array[String]): Unit = { + val reporter = new Reporter(); + val command = new HTMLGeneratorCommand( + PRODUCT, VERSION, reporter, new HTMLGeneratorPhases()); + if (command.parse(args) && command.files.list.size() > 0) { + val global = new Global(command); + global.compile(command.files.toArray(), false); + global.stop("total"); + global.reporter.printSummary(); + } + System.exit(if (reporter.errors() > 0) 1 else 0); + } + +} |